Fork me on GitHub
#pedestal
<
2017-07-29
>
andrea.crotti10:07:52

how do I actually get code reloading to work in Pedestal?

andrea.crotti10:07:13

I just used the default template and used run-dev

andrea.crotti10:07:19

(defn run-dev
  "The entry-point for 'lein run-dev'"
  [& args]
  (println "\nCreating your [DEV] server...")
  (-> service/service ;; start with production configuration
      (merge {:env :dev
              ;; do not block thread that starts web server
              ::server/join? false
              ;; Routes can be a function that resolve routes,
              ;;  we can use this to set the routes to be reloadable
              ::server/routes #(route/expand-routes (deref #'service/routes))
              ;; all origins are allowed in dev mode
              ::server/allowed-origins {:creds true :allowed-origins (constantly true)}})
      ;; Wire up interceptor chains
      server/default-interceptors
      server/dev-interceptors
      server/create-server
      server/start))

andrea.crotti10:07:32

but it doesn't seem to be reload the code no matter what I do

andrea.crotti10:07:34

I'm actually running the server in the terminal and use Emacs+cider, so the two things are not actually linked up, but I thought it would still reload when some code changes anyway

ikitommi17:07:15

hmm… pedestal doesn’t work with the latest clojure.spec? 0.5.2 fails with [org.clojure/clojure "1.9.0-alpha17"] due to a broken ns-form.

lxsameer18:07:19

are you sure? I'm using it with the same version

lxsameer18:07:26

what's the error message ?

bherrmann22:07:36

@andrea.crotti 1. Start emacs, 2. cider-jack-in 3. from in emacs from the cider-repl do (dev-run)