Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

route specific middleware for restify #116

Open
terencechow opened this issue Dec 29, 2017 · 0 comments
Open

route specific middleware for restify #116

terencechow opened this issue Dec 29, 2017 · 0 comments

Comments

@terencechow
Copy link

terencechow commented Dec 29, 2017

This library is used in swagger-restify-mw but I am unable to have route specific middleware with restify as a result.

Restify requires route specific middleware in the following signature:

server.get('/someroute', [ middleware1, middleware2, someHandler])

However when I export an array for a route I get the error found in line 92 of swagger_router.js
Specifically it looks for a controller that is of type function typeof controllerFunction === 'function'.

Hence I can't do

export const myHandler = [ authenticationMiddleware, routeHandler]

Is there a way to add route specific middleware for restify that is compatible with swagger node runner?

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

No branches or pull requests

1 participant