Open
Description
Right now middlewares are either:
- A function
- 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 Process remains running after server close #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.