-
Notifications
You must be signed in to change notification settings - Fork 0
Router Settings
All router settings are optional.
:not-found
is the Gate handler that is called when no route matches the request.
:middleware
is a sequence of middleware to be applied to every route in the router.
:resources
allows a Gate router to serve static files (a setting disabled by default).
For more information about Gate and resources check wiki/Resources.
For performance reasons, Gate waits until after a handler matching the request is found to apply middleware to that handler.
Sometimes, however, you need to modify requests before trying to find a matching route. This is what preware is good for. A preware function is some function that takes a Ring request and returns a (maybe modified) Ring request. :preware
is a sequence of preware.
DNA is the basis of route expansion, and it seemed advisable to allow users to provide a custom dna to expand routes from. I'm not sure how this would be useful other than prepending some path information to all routes (which could also be done other ways), but the possibility exists.