How come home-routes
and service-routes
are defined as functions rather than values?
In src/clj/my-app/handler.clj
(mount/defstate app-routes
:start
(ring/ring-handler
(ring/router
[*(home-routes) ;* <-- Function call
*(service-routes)*]) ; <-- Function call
...))
In src/clj/my-app/routes/services.clj
(*defn* service-routes []
...)
Initially I thought it was necessary for the wrap-reload
ring middleware to work. But I tried changing the above to
In src/clj/my-app/handler.clj
(mount/defstate app-routes
:start
(ring/ring-handler
(ring/router
[(home-routes)
*service-routes*]) ; <-- Now just a value
...))
In src/clj/my-app/routes/services.clj
(*def* service-routes
...)
and wrap-reload still works, i.e. if you change something in service-routes
, save the services.clj file, and reload the page then the swagger-ui page gets updated.