mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Update shared routes doc
Added missing require. Removed use of `or` and added the else branch to the `if` statement.
This commit is contained in:
parent
19ae220d5f
commit
3f05328a68
1 changed files with 7 additions and 6 deletions
|
|
@ -53,14 +53,15 @@ For the backend, we can use a custom-expander to expand the routes:
|
|||
|
||||
```clj
|
||||
(require '[reitit.ring :as ring])
|
||||
(require '[reitit.core :as r])
|
||||
|
||||
(defn my-expand [registry]
|
||||
(fn [data opts]
|
||||
(or (if (keyword? data)
|
||||
(if (keyword? data)
|
||||
(some-> data
|
||||
registry
|
||||
(r/expand opts)
|
||||
(assoc :name data)))
|
||||
(assoc :name data))
|
||||
(r/expand data opts))))
|
||||
|
||||
;; the handler functions
|
||||
|
|
|
|||
Loading…
Reference in a new issue