|
|
|
@@ -5,11 +5,20 @@ |
|
|
|
[ring.util.response :as resp] |
|
|
|
[ring.middleware.reload :refer [wrap-reload]])) |
|
|
|
|
|
|
|
(defroutes app-routes |
|
|
|
(GET "/" [] (resp/resource-response "index.html" {:root "public"})) |
|
|
|
(resources "/") |
|
|
|
(not-found "<h1>Page not found</h1>")) |
|
|
|
|
|
|
|
(defn -main [] |
|
|
|
(jetty/run-jetty (wrap-reload #'app-routes) {:port 8000}) |
|
|
|
(println (str "Server is running on port 8000"))) |
|
|
|
;; (defroutes app-routes |
|
|
|
;; (GET "/" [] (resp/resource-response "index.html" {:root "public"})) |
|
|
|
;; (resources "/") |
|
|
|
;; (not-found "<h1>Page not found</h1>")) |
|
|
|
|
|
|
|
;; (defn -main [] |
|
|
|
;; (jetty/run-jetty (wrap-reload #'app-routes) {:port 8000}) |
|
|
|
;; (println (str "Server is running on port 8000"))) |
|
|
|
|
|
|
|
(def route-set #{"/" "/tokenpage"}) |
|
|
|
|
|
|
|
(defn handler [req] |
|
|
|
(or |
|
|
|
(when (route-set (:uri req)) |
|
|
|
(some-> (resp/resource-response "index.html" {:root "public"}) |
|
|
|
(resp/content-type "text/html; charset=utf-8"))) |
|
|
|
(not-found "Not found"))) |