This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-11-23
Channels
- # announcements (5)
- # beginners (14)
- # bigdata (1)
- # calva (13)
- # cider (10)
- # clj-kondo (53)
- # cljs-dev (1)
- # cljsrn (12)
- # clojure (67)
- # clojure-uk (8)
- # clojuredesign-podcast (3)
- # clojurescript (53)
- # duct (4)
- # emacs (1)
- # events (1)
- # figwheel-main (5)
- # fulcro (9)
- # graalvm (68)
- # graphql (3)
- # joker (3)
- # juxt (4)
- # off-topic (32)
- # other-languages (1)
- # pathom (35)
- # re-frame (6)
- # rum (1)
- # shadow-cljs (52)
- # spacemacs (3)
- # sql (10)
- # tools-deps (15)
Hi, I'm learning clojurescript and re-frame. Everythings been working fine developing using the basic re-frame lein template, in VS Code with Calva (ctrl+alt+c j). Now I want to know how to deploy my small web app. According to the instructions I should do "lein clean" and "lein prod". Does this build stuff into the resources/public folder? When I open the index.html there I get a blank page (only correct background color), and lots of errors. How do I do this? (P.S. I don't know web development from before)
Can you visit http://localhost:8280 ?
resources/public is for files to be served from the server. They usually won't work opened directly because the references to other files depend on the server being there
It doesn't look like that template includes a production server setup (other than Heroku), but there is a +handler option that does lein new re-frame <project-name> +handler
Hmm ok. I have misunderstood what "lein prod" does. I thought I could just copy the files. I will take a look at +handler. Thanks!
With deps.edn, is it possible to have git dependency located locally?
What if you want a different commit than the latest one?
how can I cast something into integer or if it's not an int force it to be zero?
When you say an int, do you mean the integers in the 32-bit signed range of a Java int, or do you mean arbitrary integers of any size?
If you mean arbitrary integers of any size, then if it is already an integer, there isn't any need to cast it, is there?
user=> (defn int-or-0 [x]
(if (integer? x) x 0))
#'user/int-or-0
user=> (int-or-0 nil)
0
user=> (int-or-0 1.5)
0
user=> (int-or-0 7)
7