Open intfract opened 1 year ago
It would be nice if the Router allowed callback functions or route mapping for server variables. Sometimes, I want different locals to be rendered for every route. Mapping a route to a locals object would be efficient.
Router
locals
new Router(app, { '': { x: 'home' }, 'user': (req, res) => { { x: req.params.username } }, })
Dynamic locals can be functions while static locals can simply be plain objects.
This will take some time. Route mapping is quite complicated but doable.
It would be nice if the
Router
allowed callback functions or route mapping for server variables. Sometimes, I want differentlocals
to be rendered for every route. Mapping a route to a locals object would be efficient.Dynamic locals can be functions while static locals can simply be plain objects.