Fork me on GitHub
#lein-figwheel
<
2016-08-18
>
kiko09:08:49

Hi, newbie question. How can I change :websocket-url ? Here's my project.clj, it doesn't reflect the port I specified. https://gist.github.com/kiko/91be403a61c552aa07790f89c8db1d59#file-project-clj-L59

luposlip10:08:06

@kiko: without being an expert (at all), you need to define the port server side via project.clj (I’ve been using :server-port for this), and then make sure from the client side to connect to this. E.g. using figwheel.client/watch-and-reload. This is where you put the :websocket-url, and optionally a :jsload-callback.

kiko13:08:38

@luposlip Thanks. Where the figwheel.client/watch-and-reload should be placed at? By the way, https://github.com/bhauman/lein-figwheel#client-side-configuration-options says :websocket-url to be under :cljsbuild, this confuses me. oO

luposlip13:08:34

@kiko: Perhaps the :websocket-url is being inserted somewhere dynamically by cljsbuild. In my setup I have this in project.clj:

:figwheel {:server-port 3450}
and this in dev/start.cljs which is only compiled in development mode (as configured in project.clj):
(figwheel.client/watch-and-reload
  :websocket-url ""
  :jsload-callback #(js/console.log "figwheel ready"))

kiko13:08:20

ohh i found that under env/dev/cljs/<app-name>/dev.cljs ...changing it and finger crossed...

kiko13:08:47

beautiful, it works! 😄

kiko13:08:53

Sorry today is my day 1 of cljs. Thanks a lot @luposlip!

luposlip13:08:22

happy to help @kiko! 🙂