diff options
author | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
---|---|---|
committer | Miguel Ángel Moreno <mail@migalmoreno.com> | 2023-01-17 13:17:40 +0100 |
commit | 81f03c0b449bec1fa60cf2936bfc3f66a5ad58c1 (patch) | |
tree | a2a7aa01f61dd71b511dd3729a9f4b28c35b531f /src/backend/tau/router.clj | |
parent | 5e995881dd0c431ae63b1a50c2d03e59962241f1 (diff) |
chore: Rename project
Diffstat (limited to 'src/backend/tau/router.clj')
-rw-r--r-- | src/backend/tau/router.clj | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/src/backend/tau/router.clj b/src/backend/tau/router.clj deleted file mode 100644 index 5bab278..0000000 --- a/src/backend/tau/router.clj +++ /dev/null @@ -1,58 +0,0 @@ -(ns tau.router - (:require - [malli.experimental.lite :as l] - [reitit.ring :as ring] - [reitit.coercion :as coercion] - [reitit.ring.coercion :as rrc] - [reitit.coercion.malli] - [ring.middleware.reload :refer [wrap-reload]] - [ring.middleware.params :refer [wrap-params]] - [ring.middleware.json :refer [wrap-json-response]] - [ring.middleware.cors :refer [wrap-cors]] - [tau.handler :as handler])) - -(def router - (ring/router - [["/" handler/index] - ["/search" handler/index] - ["/stream" handler/index] - ["/channel" handler/index] - ["/playlist" handler/index] - ["/kiosk" handler/index] - ["/api" - ["/services" - ["" {:get handler/services}] - ["/:service-id/search" - {:get {:coercion reitit.coercion.malli/coercion - :parameters {:path {:service-id int?} - :query {:q string?}} - :handler handler/search}}] - ["/:service-id" - ["/default-kiosk" {:get {:coercion reitit.coercion.malli/coercion - :parameters {:path {:service-id int?}} - :handler handler/kiosk}}] - ["/kiosks" - ["" {:get {:coercion reitit.coercion.malli/coercion - :parameters {:path {:service-id int?}} - :handler handler/kiosks}}] - ["/:kiosk-id" {:get {:coercion reitit.coercion.malli/coercion - :parameters {:path {:service-id int? :kiosk-id string?}} - :handler handler/kiosk}}]]]] - ["/streams/:url" {:get handler/stream}] - ["/channels/:url" {:get handler/channel}] - ["/playlists/:url" {:get handler/playlist}] - ["/comments/:url" {:get handler/comments}]]] - {:data {:middleware [rrc/coerce-request-middleware - rrc/coerce-response-middleware - rrc/coerce-exceptions-middleware]}})) - -(def app - (ring/ring-handler - router - (ring/routes - (ring/create-resource-handler {:path "/"}) - (ring/create-default-handler - {:not-found (constantly {:status 404, :body "Not found"})})) - {:middleware [wrap-params - [wrap-json-response {:pretty true}] - wrap-reload]})) |