-
Notifications
You must be signed in to change notification settings - Fork 93
Open
Description
I want to create a router for <website.com>/cv1 and serve a pdf.
Locally, it works just fine. That is, curl will work. And, the page renders a pdf on the browser.
But, in my website, it gives 404, www.buddhilw.com/cv1.
In the server.clj, I defined the router cv1, as so:
(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 "<path>.pdf") and dropping the(let [config (resolve-config)] ...)` stuff
None worked.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
