express.io icon indicating copy to clipboard operation
express.io copied to clipboard

Using Express.js middleware in Express.io

Open prateekbhatt opened this issue 10 years ago • 1 comments

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?

prateekbhatt avatar Mar 24 '14 12:03 prateekbhatt

Did you try express.io-middleware ?

You should be able to do want you want.

vincentpeyrouse avatar May 30 '14 10:05 vincentpeyrouse