Closed stonetwig closed 9 years ago
I think the issue is that I am using the route/not-found
function since this is the source:
(defn not-found
"A route that returns a 404 not found response, with its argument as the
response body."
[body]
(rfn request
(-> (response/render body request)
(status 404))))
I'll ask in the compojure repo instead.
Did you find this out? I can help out a bit if you tell me where you're at now.
That's alright, I solved it :)
This is a snippet from my current code. We're using stasis and optimus to serve static files like markdown. However, I was in a need to add new routes to this project with more than just static content.
I added compojure and selmer because I suck at clojure, and while it works I now receive a very weird 404 on the files stasis/optimus is supposed to serve.
It renders everything perfectly except I get 404 on all static files.
An image:![](https://s3.amazonaws.com/f.cl.ly/items/3f2F123k0P2p223p0e3R/Image%202015-09-03%20at%208.51.18%20am.png)
As you can see, the compiled static files all gets 404 even the initial request even if it renders the correct html (which is weird indeed).
But if I do a request to the resource requested by the browser, it renders perfectly well:![](https://s3.amazonaws.com/f.cl.ly/items/0r2C1t2k0N1X0X1a0O1p/Image%202015-09-03%20at%208.53.03%20am.png)
The problem started when I added the compojure dependency because I wanted more simple routing, however the only way I found to send all request that didn't fit a specific route where the
route/not-found
function and my guess is that's what making the problem occur.My question is if you know a simple way to keep all existing stasis/optimus code and how to add a new route that can render a specific page? If it could be done with the compojure dep it would be awesome. This might not be stasis related exactly (I think), but since I am a noob at clojure I am not sure.