This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-13
Channels
- # announcements (1)
- # babashka (29)
- # beginners (64)
- # calva (4)
- # cider (5)
- # cljs-dev (3)
- # cljsrn (2)
- # clojure (100)
- # clojure-australia (2)
- # clojure-conj (7)
- # clojure-dev (9)
- # clojure-europe (31)
- # clojure-germany (1)
- # clojure-nl (2)
- # clojure-uk (13)
- # clojured (2)
- # clojurescript (62)
- # community-development (2)
- # conjure (1)
- # cursive (21)
- # datomic (39)
- # events (2)
- # fulcro (7)
- # graalvm (24)
- # graalvm-mobile (11)
- # holy-lambda (3)
- # jobs (7)
- # lsp (15)
- # malli (26)
- # music (1)
- # nyc (2)
- # off-topic (18)
- # reagent (23)
- # reitit (5)
- # remote-jobs (1)
- # shadow-cljs (2)
- # tools-deps (26)
- # vim (6)
- # xtdb (17)
With this router
(rring/ring-handler router
(rring/routes
(rring/create-resource-handler {:root "shadow-output" :path "/"})
(rring/create-file-handler {:root "public" :path "/"})
(rring/create-default-handler))
{:middleware [[(fn [handler]
(ring-dflt/wrap-defaults handler ring-dflt/site-defaults))]]})
I'm getting a weird figwheel index page served. I'm not using figwheel at all. If i remove the middleware the correct index is served from (from the file handler, it's in public
). But I need to use the middleware. Any easy fix for this?Ok figured this out, it's because the site-defaults
map includes settings to serve public
resources, which was in my resources from another project
Also, and this is related, any tips on using reitit with sente would be greatly appreciated 🙂 I'm aware of https://github.com/metosin/reitit/issues/205 but can't for the life of me get ring wrap-defaults
to work which is needed for the csrf token that sente uses
Got it!
(rring/ring-handler router
(rring/routes
(rring/create-file-handler {:root "public" :path "/"})
(rring/create-resource-handler {:root "shadow-output" :path "/"})
(rring/create-default-handler))
{:middleware [[(fn [routes]
(ring-dflt/wrap-defaults routes
(dissoc ring-dflt/site-defaults :static)))]]})
is what worked for me as far as ring's wrap-defaults
goes