I have a static file called index.html that I’d like to serve when someone requests /. Usually web servers do this by default, but Compojure doesn’t. How can I make Compojure serve index.html when someone requests /?
Here’s the code I’m using for the static directory:
; match anything in the static dir at resources/public
(route/resources "/")
This would be a pretty simple Ring middleware:
Just wrap your routes with this function, and requests for
/get transformed into requests for/index.htmlbefore the rest of your code sees them.