Skip to content

Instantly share code, notes, and snippets.

@oitee
Last active October 12, 2022 14:41
Show Gist options
  • Save oitee/9429be6f482c52efeda9d908f7b870a6 to your computer and use it in GitHub Desktop.
Save oitee/9429be6f482c52efeda9d908f7b870a6 to your computer and use it in GitHub Desktop.
(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