core icon indicating copy to clipboard operation
core copied to clipboard

Fancy middlewares

Open evert opened this issue 3 years ago • 0 comments

Right now middlewares are either:

  1. A function
  2. An object with a middlewareCall symbol function

I think it would be very helpful if the object middlewares have a few more features:

  • The ability to clean up when the server is shutting down. See #160
  • The ability to indicate if they should be called before or after a different middleware. This is helpful because a lot of middlewares are dependent on each other, which means that a very strict order is needed. Middlewares have no good way to complain if for example the 'bodyparser' middleware was not loaded and it needs a parsed body.

evert avatar Feb 09 '22 01:02 evert