mirror of
https://github.com/metosin/reitit.git
synced 2025-12-18 08:51:12 +00:00
Polish example
This commit is contained in:
parent
492d5e2f2b
commit
7c7b8dd8a5
1 changed files with 25 additions and 25 deletions
|
|
@ -52,23 +52,23 @@
|
|||
[:pre (with-out-str (fedn/pprint @match))]])
|
||||
|
||||
(def routes
|
||||
(rf/router
|
||||
["/"
|
||||
[""
|
||||
[["/"
|
||||
{:name ::frontpage
|
||||
:view home-page}]
|
||||
["about"
|
||||
|
||||
["/about"
|
||||
{:name ::about
|
||||
:view about-page}]
|
||||
["item/:id"
|
||||
|
||||
["/item/:id"
|
||||
{:name ::item
|
||||
:view item-page
|
||||
:parameters {:path {:id s/Int}
|
||||
:query {(s/optional-key :foo) s/Keyword}}}]]
|
||||
{:data {:coercion rsc/coercion}}))
|
||||
:query {(s/optional-key :foo) s/Keyword}}}]])
|
||||
|
||||
(defn init! []
|
||||
(rfe/start! routes
|
||||
(rfe/start!
|
||||
(rf/router routes {:data {:coercion rsc/coercion}})
|
||||
(fn [m] (reset! match m))
|
||||
{:use-fragment true})
|
||||
(r/render [current-page] (.getElementById js/document "app")))
|
||||
|
|
|
|||
Loading…
Reference in a new issue