This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-15
Channels
- # beginners (11)
- # boot (80)
- # carry (1)
- # cider (5)
- # cljs-dev (290)
- # cljsrn (4)
- # clojure (50)
- # clojure-canada (5)
- # clojure-dev (2)
- # clojure-korea (2)
- # clojure-russia (17)
- # clojure-spec (22)
- # clojurescript (41)
- # cursive (12)
- # datomic (10)
- # figwheel (1)
- # hoplon (68)
- # klipse (1)
- # off-topic (1)
- # om (16)
- # onyx (15)
- # parinfer (1)
- # proto-repl (4)
- # proton (2)
- # re-frame (14)
- # reagent (12)
- # ring (5)
- # vim (4)
- # yada (34)
I'm having a hard time with boot's read-only permissions, is there a way to tell sift or another way to change target to read-write?
so in the repl, i can run the start-server from aleph, and it starts the server. how do i do that in a boot task?
(deftask aleph
[]
(let [start (delay (aleph/start-the-server))]
(with-pass-thru fs @start)))
@pvinis or you can use https://github.com/danielsz/system/blob/master/src/system/components/aleph.clj
This is maybe more of a ring problem than a boot problem but I'm using boot-http and everyone's asleep in the ring channel---
(All I know is, I used to be able to see a reagent page I was making and now localhost:3000/ is a Not Found)
@thomas boot-http
uses its own (ring) server and serves from the classpath the files. So it needs some sort of configuration in order to extract your static assets and serve them
@richiardiandrea I told boot about my handler https://github.com/mathpunk/anansi/blob/server/build.boot#L39
@thomas ok I did not see the code sorry
@thomas maybe because of this? https://github.com/weavejester/compojure/blob/master/src/compojure/route.clj#L42
I think, more specifically, the issue is that the default for that compojure helper is to expect things to be inside of a public
folder. But looking at your resources
directory, everything is in the root. So, @mathpunk you can either move all the folders in your resources
directory into resources/public
or you can set the option on route/resources
like so:
(route/resources "/" {:root "."})
I'm not 100% sure that second suggestion will work. And I'd recommend moving your website files into resources/public
anyway since it's a common convention
hmmm. appears I'm totally wrong. Also, the code that's on github works just fine for me. I can load your reagent app on localhost:3000
after running boot dev
@mathpunk
So, I got rid of your other routes besides (route/resources "/")
and the server started showing something different:
Problem accessing /index.html. Reason:
java.io.FileNotFoundException: Could not locate garden/def__init.class or garden/def.clj on classpath., compiling:(anansi/styles.clj:1:1)
@geoffs There's an :output-to
in build.boot.... maybe that's gotta be "public/css" to match?
having only been web-devving for 6 months it's hard to know what older conventions these things are emulating...
but if it's set to 'resources' i'd imagine that it sees public inside resources as well
I got it working by also adding an explicit dependency on garden
like so:
;; prod
[ring/ring-core "1.5.0"]
[compojure "1.5.1"]
[com.cognitect/transit-cljs "0.8.239"]
[reagent-material-ui "0.2.1"]
[datascript "0.15.4"]
[garden "1.3.2"] ;; <=========== add this
])
Here's a new question, which I think is more boot-related or at least classpath-related: now I want to use transit on the server, so I add [com.cognitect/transit-clj...]
to the build.boot dependencies. But, if I require it with (:require [cognitect.transit :as transit])
, I get no such var
and yet it seems like you just chuck all the deps, cljs and clj, into the same spot in the build.boot
@mathpunk when you do (require '[foo.bar :as bar])
it will not create a var named bar
, is that what you mean?
@micha hm, well i'm in a file rather than the repl but when I run my boot dev
I get,
if you just do cognitect.transit
you will get a "no such var" exception, because the namespace isn't a var
i don't really understand what vars are, but i think you're saying that i can't include this dependency in my source file like i require other dependencies
No, here it is in context: https://github.com/mathpunk/anansi/blob/server/src/clj/anansi/data.clj