Last active
July 11, 2020 17:18
-
-
Save athomasoriginal/15ab9f5e01832fda677f80dd635aff46 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(comment | |
(require '[reitit.ring :as reitit]) | |
(require '[ring.adapter.jetty :as jetty]) | |
(defn health-check-route [] | |
["/health-check" | |
{:get | |
{:handler | |
(fn [_] | |
{:status 200 | |
:headers {"Content-Type" "text/plain"} | |
:body "We good, blue?"})}}]) | |
(defn router [] | |
(reitit/router | |
[(health-check-route)])) | |
;; NO BUENO - NOT REPL FRIENDLY - :( | |
(def app | |
(reitit/ring-handler (router) (constantly {:status 404}))) | |
;; BUENO - REPL FRIENDLY - :) | |
(defn app | |
[req] | |
((reitit/ring-handler (router) (constantly {:status 404})) req)) | |
(def server (jetty/run-jetty #'app {:port 3000 :join? false}))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment