I used Sails.js + Passport.js authentication through websockets to bind passport.js methods for requests through websockets (using sockets.io) , but how should i add express-validator methods to ensure that all requests have methods from it
You can do it without using customMiddleware by adding 'express-validator' in the config/http.js
:
order: [
'startRequestTimer',
'cookieParser',
'session',
'expressValidator',
'bodyParser',
'handleBodyParserError',
'compress',
'methodOverride',
'poweredBy',
'$custom',
'router',
'www',
//'favicon',
'404',
'500'
],
expressValidator: require('express-validator')()
This should get you express validator and you can import and use it.
Hope it solves your query.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With