Skip to content
This repository has been archived by the owner on Apr 11, 2018. It is now read-only.

get all possible GET, POST ... routes? #25

Open
balazsnemeth opened this issue May 26, 2016 · 4 comments
Open

get all possible GET, POST ... routes? #25

balazsnemeth opened this issue May 26, 2016 · 4 comments

Comments

@balazsnemeth
Copy link

Is it possible to list all of the POST, GET ... routes?

@JamesMessinger
Copy link
Owner

You mean like an endpoint that you'd go to that would return a list of all the routes as plain-text?

@balazsnemeth
Copy link
Author

balazsnemeth commented May 26, 2016

Thanks for the quick response!

I would like to override all of my posts, here how I'm overriding one:

 server.post('/path', function(req, res, next) {
    res.json(success); 
  });

Is is possible to override all POST?
Is it possible to get the 'path' of all registered POST requests?

(I just don't want to manually type all of my POST path-es)

@JamesMessinger
Copy link
Owner

Ah, I see what you mean. You want to be able to dynamically add your own middleware based on the endpoints that are in the Swagger definition.

Swagger Server doesn't currently expose that information to you. Although, I like the idea of exposing it, so I'm totally going to add that to the to-do list. But, in the meantime, you can use Swagger Parser (which Swagger Server uses internally) yourself to get that info, and then add your middleware accordingly.

@balazsnemeth
Copy link
Author

Exactly, thanks for adding this to the TODO list.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants