Fork me on GitHub
#beginners
<
2019-11-23
>
juri16:11:59

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)

jshaffer211216:11:06

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

jshaffer211216:11:40

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

juri21:11:25

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!

neo255119:11:25

With deps.edn, is it possible to have git dependency located locally?

lucio20:11:21

@neo2551 {:local/root “/path/to/proj”}

neo255120:11:47

What if you want a different commit than the latest one?

lucio20:11:32

Checkout that commit on the local project

sova22:11:13

how can I cast something into integer or if it's not an int force it to be zero?

andy.fingerhut00:11:11

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?

andy.fingerhut00:11:38

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?

andy.fingerhut00:11:23

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