|
@@ -2,16 +2,13 @@
|
|
|
(:require [ring.middleware.resource :refer [wrap-resource]]
|
|
|
[org.httpkit.server :refer [run-server]]))
|
|
|
|
|
|
-(defn say-hi [req] false) ;{:status 200 :body "hi" :content-type "text/plain"}
|
|
|
+(defn say-hi [req]
|
|
|
+ (when (.startsWith (:uri req) "/hi")
|
|
|
+ {:status 200 :body "hi" :content-type "text/plain"}))
|
|
|
|
|
|
-(def appx (-> say-hi
|
|
|
+(def app (-> say-hi
|
|
|
(wrap-resource "public")))
|
|
|
|
|
|
-(defn app [req] {:status 200 :body "hi" :content-type "text/plain"})
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
(defn start! []
|
|
|
(println "server on.")
|
|
|
(run-server app {:port 8080}))
|