diff --git a/doc/basics/route_conflicts.md b/doc/basics/route_conflicts.md index 401a2aa9..8a16ce29 100644 --- a/doc/basics/route_conflicts.md +++ b/doc/basics/route_conflicts.md @@ -1,8 +1,8 @@ # Route Conflicts -Many routing libraries allow multiple matches for a single path lookup. Usually, the first match is used and the rest are effecively unreachanle. This is not good, especially if route tree is merged from multiple sources. +Most routing libraries allow conflicting paths within a router. On lookup, the first match is used making rest of the matching routes effecively unreachable. This is not good, especially if route tree is merged from multiple sources. -Reitit resolves this by running explicit conflicit resolution when a `router` is called. Conflicting routes are passed into a `:conflicts` callback. Default implementation throws `ex-info` with a descriptive message. +Reitit resolves this by running explicit conflicit resolution when a Router is created. Conflicting routes are passed into a `:conflicts` callback. Default implementation throws `ex-info` with a descriptive message. Examples router with conflicting routes: diff --git a/doc/basics/route_data.md b/doc/basics/route_data.md index 81d918a9..9c08c654 100644 --- a/doc/basics/route_data.md +++ b/doc/basics/route_data.md @@ -1,6 +1,6 @@ # Route Data -Route data is the heart of this library. Routes can have any data attachted to them. Data is interpeted either by the client application or the `Router` via it's `:coerce` and `:compile` hooks. This enables co-existence of both [adaptive and principled](https://youtu.be/x9pxbnFC4aQ?t=1907) components. +Route data is the heart of this library. Routes can have any data attachted to them. Data is interpeted either by the client application or the `Router` via it's `:coerce` and `:compile` hooks. Together with `clojure.spec` -validation this enables co-existence of both [adaptive and principled](https://youtu.be/x9pxbnFC4aQ?t=1907) components. Routes can have a non-sequential route argument that is expanded into route data map when a router is created. @@ -75,8 +75,6 @@ Resolved route tree: By default, `reitit/Expand` protocol is used to expand the route arguments. It expands keywords into `:name` and functions into `:handler` key in the route data map. It's easy to add custom expanders and one can chenge the whole expand implementation via [router options](../advanced/configuring_routers.md). ```clj -(require '[reitit.core :as r]) - (def router (r/router [["/ping" ::ping]