Skip to content
This repository has been archived by the owner on Jul 2, 2022. It is now read-only.

(go) has to be called every time a route is changed. #251

Open
zendevil opened this issue Feb 14, 2020 · 1 comment
Open

(go) has to be called every time a route is changed. #251

zendevil opened this issue Feb 14, 2020 · 1 comment

Comments

@zendevil
Copy link

Even when the handler is loaded using C-c C-c or C-c C-e, (go) must be used in order for the handler's update to take effect. Adding wrap-reload in config.clj doesn't solve the issue either.

@saidone75
Copy link

Hi @zendevil , I solved that by wrapping my routes directly in routes.clj

(def my-routes
  (routes
   (resources "/")
   (GET "/slackware" _ (redirect "http://slackware.com"))
   (ANY "*" _
        (-> "public/index.html"
            io/resource
            io/input-stream
            response
            (assoc :headers {"Content-Type" "text/html; charset=utf-8"})))))

(defn home-routes [endpoint]
  (wrap-reload #'my-routes))

then you just to have to re-evaluate my-routes form.

# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants