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

Use joi with restify-router #14

Closed
tsghosh opened this issue Jul 20, 2017 · 2 comments
Closed

Use joi with restify-router #14

tsghosh opened this issue Jul 20, 2017 · 2 comments

Comments

@tsghosh
Copy link

tsghosh commented Jul 20, 2017

I am trying to add a validation using joi like this

sme.get('/country/:country/state/:state/city/:city',validator, function(req, res, next) {
})

Can you please comment if it is possible to use joi adaptor like restify-joi-middleware
with restify-router

thanks
tuhin

@ukayani
Copy link
Owner

ukayani commented Jul 24, 2017

Hi @tsghosh ,

Yes, it is possible. You can use the exact same interface as the restify server.

const sme = new Router();
sme.get('/country/:country/state/:state/city/:city', validator, function(req, res, next) {
});

sme.applyRoutes(server);

@tsghosh tsghosh closed this as completed Oct 23, 2017
@tsghosh
Copy link
Author

tsghosh commented Oct 23, 2017

Thanks.

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

2 participants