This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-10-07
Channels
- # announcements (9)
- # beginners (155)
- # bristol-clojurians (1)
- # calva (49)
- # chlorine-clover (36)
- # cider (10)
- # clara (6)
- # clj-kondo (14)
- # clojars (28)
- # clojure (226)
- # clojure-australia (1)
- # clojure-berlin (12)
- # clojure-czech (1)
- # clojure-europe (26)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (32)
- # clojurescript (9)
- # conjure (21)
- # datascript (3)
- # datomic (43)
- # emacs (3)
- # figwheel-main (16)
- # fulcro (17)
- # graalvm (9)
- # helix (4)
- # lambdaisland (3)
- # malli (13)
- # off-topic (12)
- # pathom (7)
- # re-frame (10)
- # reitit (9)
- # rewrite-clj (2)
- # shadow-cljs (41)
- # spacemacs (6)
- # specter (3)
- # test-check (5)
- # tools-deps (9)
- # tree-sitter (1)
- # vim (15)
- # xtdb (3)
https://github.com/metosin/reitit/blob/master/doc/ring/static.md
is there a way to do this
(ring/create-resource-handler {:path "/"})
to serve up your frontend but not have the index.html show in the browser?
Just add route for /
, I think: ["/" (ring/create-resource-handler)]
Or no. That will still create the redirect response.
I guess I've always written the index handler myself, instead of using the Reitit helpers.
@U061V0GG2 my goal is just to have the ability to serve up the frontend from the backend
["/" (constantly (ring.util.response/resource-response "public/index.html"))]
that makes sense. that’s actually the same way i’ve done it in the past with ring+compojure; was too hung up on the reitit helpers i suppose
(defn handle-index [req]
;; NOTE: this will deliver your index.html
(-> (response/resource-response "index.html" {:root "public"})
(response/content-type "text/html")))
Just add route for /
, I think: ["/" (ring/create-resource-handler)]