juxt / bidi

Bidirectional URI routing
MIT License
993 stars 90 forks source link

How to route to a pdf file #205

Open lccambiaghi opened 4 years ago

lccambiaghi commented 4 years ago

Hi, I have a very dumb question. If I have a pdf file in my website at https://blog.com/resume.pdf, how could I route to that file?

This is my current code:

(def app-routes
  ["/" {""               :index
        "resume"         :resume
        true             :not-found}])

(def history
  (pushy/pushy set-page! (partial bidi/match-route app-routes)))

(defn pages [path]
  (case (:handler (:current-page @state))
    :index [index]
    :resume "https://blog.com/resume.pdf"
    [not-found]))

Thank you for your help!