当一个源文件被修改后能够在开发中使用后,需要重新加载命名空间.ring-devel库为此提供了中间件.

    1. (ns myapp
    2. (:require
    3. [compojure.core :refer [GET defroutes]]
    4. [ring.middleware.reload :refer [wrap-reload]]))
    5.  
    6. (defroutes app
    7. (GET "/" [] "hello world"))
    8.  
    9. (def reloadable-app
    10. (wrap-reload app))