Closed pepe closed 3 years ago
Yeah, middleware makes sense and I don't see a problem with it. Still, it should be farily minimalist imo, just simple things like a generic server handler, or auth handler, or logging handler, etc.
Indeed that is what I had on my mind. Circlet contains:
middleware
for coercing to middlewarerouter
very simple routerlogger
printing loggercookies
extractingI would guess it is enough for the HTTP module too, and I can copy them verbatim from circlet if you agree or tell me which to copy.
I have copied over and modified all of the above middleware, and added a parser for query-strings (that was built into circlet).
I guess this new incarnation of Middleware is fine work. Thank you ❤️
Part of the circlet library was a small collection of middleware. We could add this to the HTTP module as well, if only as examples.
What do you think?