keroxp/servest

Request for adding next argument in ServeHandler

Opened this issue · 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
})

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

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