I finally managed to get the behaviour I wanted by simply matching on "
:
(defn server-routes
[]
["/"
(conj
[["" :index]
["ping" :ping]
["healthcheck" :healthcheck]
["info" :info]]
(api-routes)
["" :public])])
Where the :public
key matches a handler that serves assets out of the public directory. Another problem I had was returning the index.html if no assets are found (further routing is handled downstream by the frontend code and shows a 404). I got around this by modifying the error interceptor chain so that index.html is returned in the body on 404.Nice. Well done. You could also use a 404 status response.