Nest-cli: Route summary tool

Created on 5 Oct 2017  路  8Comments  路  Source: nestjs/nest-cli

As much as I like the module architecture, it introduces one issue, everything is split apart. In my case I ended up maintaining a file containing all my application routes.

So I thought that it would be really simple and useful to create a command like:
nest list routes
GET /api/v1/sncf/train-stop-names
POST /api/v1/sncf/train-departures
GET /api/v1/sncf/vehicle-journey

We could also display:

  • [ ] Guards
  • [ ] JSdoc
  • [ ] Async / Not
  • [ ] Return type

It would be simple to implement (crawling the .controler.ts files) and I think would be a great way to have an overview of the project and it maybe could lead to listing other framework object or even a documentation generator in case of an API.

I'm open to discussing the idea and I'd like to do it if you see any interest in it.

feature

Most helpful comment

Hey @MonsieurMan !
I love your idea !

  • Maybe something like nest tree to list routes with module hierarchy should be awesome !
  • For Guards maybe use colors on route tree ;-)
  • For JSDoc swagger integration should be enough don't you think ?
  • Async / Not like previous point as return type

All 8 comments

Hey @MonsieurMan !
I love your idea !

  • Maybe something like nest tree to list routes with module hierarchy should be awesome !
  • For Guards maybe use colors on route tree ;-)
  • For JSDoc swagger integration should be enough don't you think ?
  • Async / Not like previous point as return type

@MonsieurMan ! Great Idea :)

@ThomRick Hey, just checked out swagger, it pretty much make this idea useless as for routes, but the nest tree idea is really nice.
We could build up a tree as JSON then displaying it to the CLI or anywhere else.

OK cool ! I'll add tree command to the development plan !

Any some news?

I'm willing to implement this if you can point me in the right direction @ThomRick @kamilmysliwiec

Right now it's not clear what was agreed on

Any updates on this?

Something like adonis node ace list:routes will be awesome.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

128keaton picture 128keaton  路  3Comments

shekohex picture shekohex  路  6Comments

prateekkathal picture prateekkathal  路  5Comments

John0x picture John0x  路  6Comments

victordidenko picture victordidenko  路  4Comments