This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-21
Channels
- # aws (14)
- # babashka (35)
- # beginners (163)
- # boot (2)
- # calva (5)
- # cider (30)
- # clojure (143)
- # clojure-colombia (1)
- # clojure-europe (5)
- # clojure-nl (11)
- # clojure-spec (1)
- # clojure-uk (16)
- # clojurescript (71)
- # community-development (2)
- # conjure (1)
- # cursive (6)
- # datomic (30)
- # duct (4)
- # figwheel-main (11)
- # fulcro (28)
- # graalvm (3)
- # graphql (23)
- # hoplon (36)
- # jackdaw (24)
- # kaocha (16)
- # lambdaisland (1)
- # leiningen (4)
- # luminus (3)
- # meander (4)
- # observability (1)
- # off-topic (10)
- # pathom (5)
- # re-frame (27)
- # reitit (7)
- # remote-jobs (1)
- # sci (17)
- # shadow-cljs (22)
- # spacemacs (14)
- # sql (61)
- # testing (3)
- # tools-deps (27)
- # vim (2)
- # xtdb (18)
- # yada (2)
Hi folks, how should I write this route in Luminus (reitit) on routes/home.clj>
(GET "/:slug" [slug]
(render-wiki-page {:title "The title" :body "The body" :uri-slug slug}))
Not sure what render-wiki-page
looks like internally but maybe this might help...
(defn home-routes []
[""
{:middleware [middleware/wrap-csrf
middleware/wrap-formats]
:conflicting true}
[""
["/" {:get (fn [request] (layout/render request "home.html"))}]
["/:slug" {:get (fn [{{:keys [slug]} :path-params :as request}]
(let [title "The title" body "The body" uri-slug slug]
(layout/render request
"wiki.html"
{:title title :body body :uri-slug uri-slug})))}]
["/graphiql" {:get (fn [request] (layout/render request "graphiql.html"))}]]])
3