Deploy a basic server to render.com using Clojure, with compojure and ring.
Fork this repo and click the button below.
Render automatically redeploys the server when you push changes.
The main server logic is defined by this code (found in src/hello_compojure/handler.clj):
(defroutes app
(GET "/" [] "Hello, world!")
(GET "/health-check" [] "")
(route/not-found "Not Found"))
The /health-check
endpoint allows Render to execute zero-downtime deploys and
to automatically restart your server if it goes down.
Use lein ring server
to run the server locally, with hot reloading set up by
default.
- render docs
- compojure wiki
- lein-ring plugin
- If you want to make this server more production-ready it may help to start with ring-defaults.
This code was adapted from the Leiningen template for compojure: compojure-template. Many thanks to James Reeves, who wrote much of the most essential code that this project depends on.