making routes real
This commit is contained in:
@@ -19,7 +19,9 @@
|
||||
[ring.middleware.params :refer [wrap-params]]
|
||||
[ring.middleware.reload :refer [wrap-reload]]
|
||||
[ring.util.response :as response]
|
||||
[unilog.context :as lc]))
|
||||
[unilog.context :as lc]
|
||||
[auto-ap.client-routes :as client-routes]
|
||||
[bidi.bidi :as bidi]))
|
||||
|
||||
(when (:aws-access-key-id env)
|
||||
(defcredential (:aws-access-key-id env) (:aws-secret-access-key env) (:aws-region env)))
|
||||
@@ -33,7 +35,11 @@
|
||||
(defroutes static-routes
|
||||
(GET "/" [] (response/resource-response "index.html" {:root "public"}))
|
||||
(route/resources "/")
|
||||
(routes (ANY "*" [] (response/resource-response "index.html" {:root "public"}))))
|
||||
(routes (ANY "*" {:keys [path] :as r}
|
||||
(if (bidi/match-route client-routes/routes (:uri r))
|
||||
(response/resource-response "index.html" {:root "public"})
|
||||
{:status 404
|
||||
:body "Not found"}))))
|
||||
|
||||
(defroutes health-check
|
||||
(GET "/health-check" []
|
||||
|
||||
Reference in New Issue
Block a user