aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authors-ol <s+removethis@s-ol.nu>2021-09-29 10:35:53 +0000
committers-ol <s+removethis@s-ol.nu>2021-09-29 10:43:53 +0000
commitd5aa9e42b7c58a734aa6bf7cd3b1c987ca3ee403 (patch)
treed0b9abf8352faf88eac657e7556e25c40d5f5299
parentadd 0xC.pad, 0x2C.board /cfg links (diff)
downloadredirectly-d5aa9e42b7c58a734aa6bf7cd3b1c987ca3ee403.tar.gz
redirectly-d5aa9e42b7c58a734aa6bf7cd3b1c987ca3ee403.zip
add ba/pdf
-rw-r--r--resources/config.edn1
-rw-r--r--src/redirectly/core.clj4
2 files changed, 3 insertions, 2 deletions
diff --git a/resources/config.edn b/resources/config.edn
index 5a0a373..68f9c81 100644
--- a/resources/config.edn
+++ b/resources/config.edn
@@ -12,6 +12,7 @@
:watch-cad {:to "https://www.youtube.com/watch?v=zlG01j462A4"}
:alivecoding {:to [:mmm "/research/alivecoding"]}
:ba {:to [:mmm "/research/mmmfs"]}
+ "ba/pdf" {:to [:mmm "/research/mmmfs" ":application/pdf"]}
"ba/log" {:to [:mmm "/research/mmmfs/ba_log"]}
"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"}
diff --git a/src/redirectly/core.clj b/src/redirectly/core.clj
index 55e002c..036e937 100644
--- a/src/redirectly/core.clj
+++ b/src/redirectly/core.clj
@@ -1,7 +1,7 @@
(ns redirectly.core
(:require [carica.core :refer [config clear-config-cache!]]
[ring.util.response :as response]
- [clojure.string :refer [ends-with?]]))
+ [clojure.string :refer [join ends-with?]]))
(def routes (config :routes))
@@ -21,7 +21,7 @@
:url)))
(defmethod url :url [{to :to}] to)
-(defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path "/"))
+(defmethod url :mmm [{[_ path & rest] :to}] (str "//mmm.s-ol.nu" path "/" (join ":" rest)))
(defn handler [req]
(if-let [route (some #(matches? % (:uri req)) routes)]