cryogen-project / cryogen-project/cryogen
Router serving static-file only works locally
- Dominant language
- HTML
- Stars
- 1.1k
- Forks
- 93
- PR merge metrics
- No merged PRs in 30d
Description
## I want to create a router for /cv1 and serve a pdf.
Locally, it works just fine. That is, `curl` will work. And, the page renders a pdf on the browser.
Locally:

But, in my website, it gives 404, [www.buddhilw.com/cv1](www.buddhilw.com/cv1).
In the `server.clj`, I defined the router `cv1`, as so:
```clj
(defroutes routes
(GET "/" [] (redirect
(let [config (resolve-config)]
(path (:blog-prefix config)
(when (= (:clean-urls config) :dirty)
"index.html")))))
(GET "/cv1" [] (ring.util.response/file-response
(let [config (resolve-config)]
(path (:blog-prefix config)
"cv-2022-11-03.pdf"))))
(route/files "/")
(route/not-found "Page not found"))
```
What could I do to accomplish the file-serving?
## What I have tried
- I tried prefixing, and creating a different end-point for each. So, public/pdf/.pdf, /pdf/.pfg, .pdf.
- I tried copying the file in all possible directories, public/pdf, root, or content/pdf.
- Using only `(path ".pdf") and dropping the `(let [config (resolve-config)] ...)` stuff
None worked.
Contributor guide
Assessment
This issue has not been assessed yet.