reitit/doc/advanced/configuring_routers.md
2017-11-18 12:47:16 +02:00

1,017 B

Configuring Routers

Routers can be configured via options. Options allow things like clojure.spec validation for route data and fast, compiled handlers. The following options are available for the reitit.core/router:

key description
:path Base-path for routes
:routes Initial resolved routes (default [])
:data Initial route data (default {})
:expand Function of arg opts => data to expand route arg to route data (default reitit.core/expand)
:coerce Function of route opts => route to coerce resolved route, can throw or return nil
:compile Function of route opts => result to compile a route handler
:conflicts Function of {route #{route}} => side-effect to handle conflicting routes (default reitit.core/throw-on-conflicts!)
:router Function of routes opts => router to override the actual router implementation