Fork me on GitHub
#beginners
<
2015-08-04
>
grounded_sage04:08:53

how do I get my browser to automatically refresh with Ring? There is a section in the Web Server options that has :auto-refresh? but I don't know where to put it.

trybeee06:08:03

@grounded_sage: depends on how you run the app, i have this in main function: (run handler {:port port ...}) (options passed to run function with handler arg)

grounded_sage08:08:13

I'll put it up on GitHub to show everyone how I am running it. Basically using Stasis to create a static site but want auto-refresh in development.

ergl08:08:50

@grounded_sage: you can put it inside your project.clj too, like this

:ring {...
       :auto-refresh? true
       ...}

andrut08:08:31

hey, maybe you might need to install lein-ring and add :auto-reload? true on top of what @ergl said in your :ring options in project.clj

grounded_sage09:08:14

@ergl: this is what I have.

:ring {:handler now.core/app
         :auto-reload? true
         :auto-refresh? true
Seems to be refreshing on save now. But isn't picking up the changes.

rishat10:08:00

I got an extremely stupid question, hence here. Do I have to (new Integer βΈ°) each time I want to cast a (valid) string to a number? Or is there a more readable approach?

grounded_sage10:08:49

here is the git repo.. still getting used to github @ergl @trybeee https://github.com/CommonCreative/now.git

grounded_sage11:08:47

Ok it reloads. But only when I save it in the style.clj and then the core.clj ... I'd like to somehow get the core.clj to auto-reload as well

jeffmk16:08:23

@rishat: (read-string n) or (Integer/parseInt n)