reitit

https://cljdoc.org/d/metosin/reitit/ https://github.com/metosin/reitit/
chadhs 2020-10-07T17:58:49.072300Z

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?

juhoteperi 2020-10-07T18:09:31.072900Z

Or no. That will still create the redirect response.

juhoteperi 2020-10-07T18:10:00.073100Z

I guess I've always written the index handler myself, instead of using the Reitit helpers.

chadhs 2020-10-07T18:12:23.073300Z

@juhoteperi my goal is just to have the ability to serve up the frontend from the backend

juhoteperi 2020-10-07T18:15:03.073500Z

["/" (constantly (ring.util.response/resource-response "public/index.html"))]

chadhs 2020-10-07T18:18:18.073700Z

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

chadhs 2020-10-07T18:18:21.073900Z

(defn handle-index [req]
  ;; NOTE: this will deliver your index.html
  (-> (response/resource-response "index.html" {:root "public"})
      (response/content-type "text/html")))

chadhs 2020-10-07T18:18:34.074100Z

thanks