Closed sinclairnick closed 5 months ago
Perhaps this should not be .use
and should rather be handle(...handlers)
to be more express-ive?
On the other hand, .use is more composable.
A good UX might look like:
.use<{ user: User }>(hasUser)
// ^ is merged with Req type
.handle(req => req.user.isDefined)
This will improve composability of routes a la
It will also enable more ergonomic middleware usage with registering routes the non-express way