git.s-ol.nu redirectly / d5aa9e4
add ba/pdf s-ol 10 months ago
2 changed file(s) with 3 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
1111 :watch-cad {:to "https://www.youtube.com/watch?v=zlG01j462A4"}
1212 :alivecoding {:to [:mmm "/research/alivecoding"]}
1313 :ba {:to [:mmm "/research/mmmfs"]}
14 "ba/pdf" {:to [:mmm "/research/mmmfs" ":application/pdf"]}
1415 "ba/log" {:to [:mmm "/research/mmmfs/ba_log"]}
1516 "ba/ref/nms" {:to "https://netmarketshare.com/operating-system-market-share.aspx?options=%7B%22filter%22%3A%7B%22%24and%22%3A%5B%7B%22deviceType%22%3A%7B%22%24in%22%3A%5B%22Desktop%2Flaptop%22%2C%22Mobile%22%5D%7D%7D%5D%7D%2C%22dateLabel%22%3A%22Trend%22%2C%22attributes%22%3A%22share%22%2C%22group%22%3A%22platform%22%2C%22sort%22%3A%7B%22share%22%3A-1%7D%2C%22id%22%3A%22platformsDesktop%22%2C%22dateInterval%22%3A%22Monthly%22%2C%22dateStart%22%3A%222018-12%22%2C%22dateEnd%22%3A%222019-11%22%2C%22hiddenSeries%22%3A%7B%7D%2C%22tableOrder%22%3A%5B%5B2%2C%22desc%22%5D%5D%2C%22segments%22%3A%22-1000%22%7D"}
1617
00 (ns redirectly.core
11 (:require [carica.core :refer [config clear-config-cache!]]
22 [ring.util.response :as response]
3 [clojure.string :refer [ends-with?]]))
3 [clojure.string :refer [join ends-with?]]))
44
55 (def routes (config :routes))
66
2020 :url)))
2121
2222 (defmethod url :url [{to :to}] to)
23 (defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path "/"))
23 (defmethod url :mmm [{[_ path & rest] :to}] (str "//mmm.s-ol.nu" path "/" (join ":" rest)))
2424
2525 (defn handler [req]
2626 (if-let [route (some #(matches? % (:uri req)) routes)]