Merge pull request #228 from alexanderjamesking/master

Update shared routes doc
This commit is contained in:
Tommi Reiman 2019-03-05 14:00:48 +02:00 committed by GitHub
commit 70ec78a72c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -53,14 +53,15 @@ For the backend, we can use a custom-expander to expand the routes:
```clj ```clj
(require '[reitit.ring :as ring]) (require '[reitit.ring :as ring])
(require '[reitit.core :as r])
(defn my-expand [registry] (defn my-expand [registry]
(fn [data opts] (fn [data opts]
(or (if (keyword? data) (if (keyword? data)
(some-> data (some-> data
registry registry
(r/expand opts) (r/expand opts)
(assoc :name data))) (assoc :name data))
(r/expand data opts)))) (r/expand data opts))))
;; the handler functions ;; the handler functions