(ns example.core
    (:require [ring.middleware.resource :refer [wrap-resource]]
              [org.httpkit.server :refer [run-server]]))

(defn say-hi [req]
      (when (.startsWith (:uri req) "/hi")
            {:status 200 :body "hi" :content-type "text/plain"}))

(def app (-> say-hi
             (wrap-resource "public")))

(defn start! []
      (println "server on.")
      (run-server app {:port 8080}))