Boot is a Clojure build framework. Here is an example of a basic ring application that is run using boot. The project folder is shown below.
ring-helloworld
├── build.boot
└── src
└── net
└── jsloop
└── server
└── core.clj
;core.clj
(ns net.jsloop.server.core
(:require [ring.adapter.jetty :as jetty]))
(defn handler [req]
{:status 200
:body "Hello World"})
(defn -main [& args]
(jetty/run-jetty handler {:port 8080})
;boot.clj
(set-env!
:source-paths #{"src"}
:dependencies '[[org.clojure/clojure "1.8.0"]
[ring "1.5.0"]])
(require '[net.jsloop.server.core :as server])
(deftask run []
(with-pre-wrap fileset (server/-main) fileset))
From the project root, run the server using boot
.
boot run
Open http://localhost:8080 to see the response.