servest icon indicating copy to clipboard operation
servest copied to clipboard

Request for adding next argument in ServeHandler

Open itohatweb opened this issue 3 years ago • 2 comments

How about adding a next argument for middleware? Sometimes it can be useful for a middleware awaiting the execution of all other middlewares.

Eg.

app.use(async (req, next) => {
  // do some stuff
  await next()
  // do some more stuff
})

itohatweb avatar Mar 18 '21 13:03 itohatweb

Interesting. I've seen the system like that in Go's echo framework. Do you know other examples in Node/Deno framework?

keroxp avatar Mar 22 '21 00:03 keroxp

My initial idea came from oak where I used it to do eg some measurements.

itohatweb avatar Mar 27 '21 21:03 itohatweb