This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-22
Channels
- # announcements (6)
- # babashka (8)
- # beginners (136)
- # cider (5)
- # cljs-dev (1)
- # cljsrn (1)
- # clojure (198)
- # clojure-argentina (4)
- # clojure-australia (1)
- # clojure-europe (25)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-poland (1)
- # clojure-spec (4)
- # clojure-uk (4)
- # clojuredesign-podcast (4)
- # clojurescript (36)
- # conjure (11)
- # data-science (1)
- # datomic (6)
- # defnpodcast (1)
- # deps-new (5)
- # emacs (7)
- # events (1)
- # fulcro (10)
- # graalvm (9)
- # graalvm-mobile (10)
- # helix (9)
- # introduce-yourself (1)
- # jackdaw (1)
- # jobs-discuss (5)
- # kaocha (6)
- # lsp (10)
- # malli (11)
- # missionary (28)
- # off-topic (2)
- # pathom (24)
- # pedestal (7)
- # portal (1)
- # re-frame (12)
- # reagent (2)
- # reitit (1)
- # remote-jobs (1)
- # sci (7)
- # shadow-cljs (6)
- # sql (6)
- # tools-deps (10)
- # vim (9)
- # xtdb (19)
maybe this is a rookie mistake... but when I try to access the page my pedestal is hosting... I only get the text of the html I am sending as response... instead of the actual page... why?
@abhishek.mazy you need to add :headers {"Content-Type" "text/html"}
to your response
By default, if pedestal find a string on the :body
, it will write it as "text/plain"
Many thanks for this!! It is a pity that this is not specified in any of the tutorials/cookbooks... anywho!! Thanks a bunch!!
Another rookie question: I am trying to serve js files generated by figwheel. I am running a simultaneous build environment... or atleast trying to... My Folder structure is as follows:
├───resources
│ └───public
│ └───css
├───src
│ ├───backend
│ └───frontend
├───target
│ └───public
│ └───cljs-out
│ └───dev
└───test
└───frontend
Now from pedestal I'd like to supply the css folder in resources/public as well as the cljs-out folder in target/public folder as static resources.
I've added both of these paths to my deps.edn such that :paths ["src" "resources" "target/public"]
is the definition there. Additionally my service definition is as follows:
(def service {:env :prod
::http/routes routes
::http/resource-path "public"
::http/type :jetty
::http/port 8080
::http/secure-headers {:content-security-policy-settings {:object-src "none"}}})
Unfortunately when I access the page, I can't see the cljs-out folder. How can this be done?@abhishek.mazy i personally use
::http/file-path "target/public"
I don't like to use
:paths [... "folder-with-a-lot-of-gen-things"]
because will make this folder be in my classpath and the intellij indexer will blow up
Ok so after this do I remove the "folder-with-a-lot-of-gen-things" out of the :paths in deps.edn? Thanks for this I'll give it a try...
I am happy to report that now it is working for me!! 🎉 I didn't have to change the :paths in deps.edn