Skip to content

Instantly share code, notes, and snippets.

@athomasoriginal
Last active July 11, 2020 17:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athomasoriginal/15ab9f5e01832fda677f80dd635aff46 to your computer and use it in GitHub Desktop.
Save athomasoriginal/15ab9f5e01832fda677f80dd635aff46 to your computer and use it in GitHub Desktop.
(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