trailing-slash mmm URLs
s-ol
3 years ago
0 | 0 | (ns redirectly.core |
1 | 1 | (:require [carica.core :refer [config clear-config-cache!]] |
2 | [ring.util.response :as response])) | |
2 | [ring.util.response :as response] | |
3 | [clojure.string :refer [ends-with?]])) | |
3 | 4 | |
4 | 5 | (def routes (config :routes)) |
5 | 6 | |
19 | 20 | :url))) |
20 | 21 | |
21 | 22 | (defmethod url :url [{to :to}] to) |
22 | (defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path)) | |
23 | (defmethod url :mmm [{[_ path] :to}] (str "//mmm.s-ol.nu" path "/")) | |
23 | 24 | |
24 | 25 | (defn handler [req] |
25 | 26 | (if-let [route (some #(matches? % (:uri req)) routes)] |