Skip to content
Mike Walker edited this page Mar 16, 2020 · 6 revisions

Reloading namespaces when a source file is edited can be useful for development. The ring-devel library provides middleware for this purpose.

(ns myapp
  (:require
   [compojure.core :refer [GET defroutes]]
   [ring.middleware.reload :refer [wrap-reload]]))

(defroutes app
  (GET "/" [] "hello world"))

(def reloadable-app
  (wrap-reload #'app))

Next Page - Interactive Development

Clone this wiki locally