Last active
October 12, 2022 14:41
-
-
Save oitee/9429be6f482c52efeda9d908f7b870a6 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
(require '[compojure.route :as route] | |
'[compojure.core :refer [defroutes GET POST PUT DELETE ANY]] | |
'[ring.adapter.jetty :refer [run-jetty]] | |
'[ring.middleware.keyword-params :as rmkp] | |
'[ring.middleware.params :as rmp]) | |
(defroutes app-routes | |
(POST "/submit" request (handler-that-needs-params request)) | |
(GET "/submit" request handler-that-needs-params) | |
(route/not-found (str "404!"))) | |
(defn -main | |
[& _] | |
(raj/run-jetty (-> app-routes | |
rmkp/wrap-keyword-params | |
rmp/wrap-params) | |
{:port 65535 | |
:join? false})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment