express.io
express.io copied to clipboard
Using Express.js middleware in Express.io
How to use express.js middleware in express.io?
express.js middleware are functions with an arity of 3 (req, res, next)
:
app.use(function (req, res, next) {
// ......
})
whereas express.io expects middleware functions to have an arity of 2 (data, next)
:
app.io.use(function (data, next) {
// ......
})
Is there any way to use express.js middleware in express.io?
Did you try express.io-middleware ?
You should be able to do want you want.