Skip to content

Instantly share code, notes, and snippets.

@bendyorke
Last active May 13, 2016 21:11
Show Gist options
  • Save bendyorke/e41fa274727e30a12dc63b73b15399be to your computer and use it in GitHub Desktop.
Save bendyorke/e41fa274727e30a12dc63b73b15399be to your computer and use it in GitHub Desktop.
Fully featured clojure web server in 10 lines of code
#! /usr/bin/env boot
(set-env! :dependencies '[[compojure "1.5.0"]
[http-kit "2.1.8"]])
(require '[compojure.core :refer [defroutes GET]])
(require '[org.httpkit.server :refer [run-server]])
(defroutes routes
(GET "/" [] "Hello World!"))
(run-server routes {:port 9001})
(boot (wait))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment