(require '[ring.adapater.jetty :as jetty])
(jetty/run-jetty routes {:port port :host "localhost" :join? false})
Here’s a small Keyboard Maestor macro I made today:
This is gonna be a rather short and trivial post but I wanted to share it anyway because it can be useful, ocassionally.
At CodeScene, we used to not delete merged git branches, at all. The practice came from Branch Analysis. To get that data, we didn’t want to remove a merged branch immediately. However, we ended up, never deleting them which also causes a problem: over time you accumulate thousands of branches. That creates a mess and makes it hard (or impossible) to select proper branch in CodeScene itself (the max number of branches we load and display is 1000).
I bet many of you have encountered the classic problem with reloading Ring handlers:
(require '[ring.adapater.jetty :as jetty])
(jetty/run-jetty routes {:port port :host "localhost" :join? false})
Here we pass routes
to the run-jetty function.
Now, when we modify routes
those modifications are not reflected and we need to restart the server.
The problem here is
THe classic solution to the is to use a var:
(#'jetty/run-jetty routes {:port port :host "localhost" :join? false})
Notice #'
in front of the run-jetty
function invokation
This post has also been published on CodeScene Engineering blog: CodeScene Engineering blog.