Fork me on GitHub
#mount
<
2022-11-25
>
caumond15:11:16

Hi, can somebody tell me how to activate in-cljc-mode in the code below, and I want to keep the "hot refresh behavior" . I mean that I can replace with @app-routes but I loose the hot reload behavior: Thanks in advance.

(ns core
  (:require [mount.core :refer [defstate] :as mount]
            [ring.adapter.jetty :as jetty]))

(defn handler [_]
  {:status 200
   :headers {"Content-Type" "text/html"}
   :body (str "<html><body>Mount in cljc mode!</body></html>")})

(defstate app-routes
  :start handler)

(defn -main
  []
;;  (mount/in-cljc-mode)
  (mount/start)
  (jetty/run-jetty
   #'app-routes
   {:port 3000
    :join? false}))

caumond16:11:53

If I in-cljc-mode is set, @app-routes returns #function[core/handler] , but I can't apply var or #' on it. How would you proceed?