8 ms·
Right, I was specifically referring to routers like Chi where you attach middlewares to a "mux". These don't rely on function composition, and so the only way t
by atombender 7y ago
Right, I was specifically referring to routers like Chi where you attach middlewares to a "mux". These don't rely on function composition, and so the only way to pass information onwards — loggers, sessions, and so on — is to use contexts.
The community has a lot of nice middlewares that do things like basic auth, session management, cache headers, etc. If you use decorators and not middlewares, you'll have to write your own middleware code.