Skip to content
Mischov edited this page Feb 11, 2015 · 9 revisions

All router settings are optional.

:not-found

:not-found is the Gate handler that is called when no route matches the request.

:middleware

:middleware is a sequence of middleware to be applied to every route in the router.

:resources

:resources allows a Gate router to serve static files (a setting disabled by default).

For more information about Gate and resources check wiki/Resources.

:preware

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.

:base-dna

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.