mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 16:31:11 +00:00
document meta-merge
This commit is contained in:
parent
1827c1294b
commit
d45dd151b7
2 changed files with 16 additions and 15 deletions
|
|
@ -11,9 +11,9 @@ Routers can be configured via options. The following options are available for t
|
||||||
| `:syntax` | Path-parameter syntax as keyword or set of keywords (default #{:bracket :colon})
|
| `:syntax` | Path-parameter syntax as keyword or set of keywords (default #{:bracket :colon})
|
||||||
| `:expand` | Function of `arg opts => data` to expand route arg to route data (default `reitit.core/expand`)
|
| `: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`
|
| `:coerce` | Function of `route opts => route` to coerce resolved route, can throw or return `nil`
|
||||||
| `:meta-merge` | Function which follows the signature of `meta-merge.core/meta-merge`, useful for when you want to have more control over the meta merging
|
|
||||||
| `:compile` | Function of `route opts => result` to compile a route handler
|
| `:compile` | Function of `route opts => result` to compile a route handler
|
||||||
| `:validate` | Function of `routes opts => ()` to validate route (data) via side-effects
|
| `:validate` | Function of `routes opts => ()` to validate route (data) via side-effects
|
||||||
| `:conflicts` | Function of `{route #{route}} => ()` to handle conflicting routes
|
| `:conflicts` | Function of `{route #{route}} => ()` to handle conflicting routes
|
||||||
| `:exception` | Function of `Exception => Exception ` to handle creation time exceptions (default `reitit.exception/exception`)
|
| `:exception` | Function of `Exception => Exception ` to handle creation time exceptions (default `reitit.exception/exception`)
|
||||||
|
| `:meta-merge` | Function of `left right => merged` to merge route-data (default `meta-merge.core/meta-merge`)
|
||||||
| `:router` | Function of `routes opts => router` to override the actual router implementation
|
| `:router` | Function of `routes opts => router` to override the actual router implementation
|
||||||
|
|
|
||||||
|
|
@ -314,20 +314,21 @@
|
||||||
Selects implementation based on route details. The following options
|
Selects implementation based on route details. The following options
|
||||||
are available:
|
are available:
|
||||||
|
|
||||||
| key | description
|
| key | description
|
||||||
| -------------|-------------
|
| --------------|-------------
|
||||||
| `:path` | Base-path for routes
|
| `:path` | Base-path for routes
|
||||||
| `:routes` | Initial resolved routes (default `[]`)
|
| `:routes` | Initial resolved routes (default `[]`)
|
||||||
| `:data` | Initial route data (default `{}`)
|
| `:data` | Initial route data (default `{}`)
|
||||||
| `:spec` | clojure.spec definition for a route data, see `reitit.spec` on how to use this
|
| `:spec` | clojure.spec definition for a route data, see `reitit.spec` on how to use this
|
||||||
| `:syntax` | Path-parameter syntax as keyword or set of keywords (default #{:bracket :colon})
|
| `:syntax` | Path-parameter syntax as keyword or set of keywords (default #{:bracket :colon})
|
||||||
| `:expand` | Function of `arg opts => data` to expand route arg to route data (default `reitit.core/expand`)
|
| `: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`
|
| `: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
|
| `:compile` | Function of `route opts => result` to compile a route handler
|
||||||
| `:validate` | Function of `routes opts => ()` to validate route (data) via side-effects
|
| `:validate` | Function of `routes opts => ()` to validate route (data) via side-effects
|
||||||
| `:conflicts` | Function of `{route #{route}} => ()` to handle conflicting routes
|
| `:conflicts` | Function of `{route #{route}} => ()` to handle conflicting routes
|
||||||
| `:exception` | Function of `Exception => Exception ` to handle creation time exceptions (default `reitit.exception/exception`)
|
| `:exception` | Function of `Exception => Exception ` to handle creation time exceptions (default `reitit.exception/exception`)
|
||||||
| `:router` | Function of `routes opts => router` to override the actual router implementation"
|
| `:meta-merge` | Function of `left right => merged` to merge route-data (default `meta-merge.core/meta-merge`)
|
||||||
|
| `:router` | Function of `routes opts => router` to override the actual router implementation"
|
||||||
([raw-routes]
|
([raw-routes]
|
||||||
(router raw-routes {}))
|
(router raw-routes {}))
|
||||||
([raw-routes opts]
|
([raw-routes opts]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue