this is the snippet that manages the http server lifecycle:
(defstate web-server :start (start-www config)
:stop (.stop web-server))
$ git clone https://github.com/tolitius/stater
$ cd stater/smsio
boot into REPL:
$ boot repl (master ✔ )
nREPL server started on port 50164 on host 127.0.0.1 - nrepl://127.0.0.1:50164
boot.user=> (dev)
#object[clojure.lang.Namespace 0x109e474 "dev"]
starting it:
dev=> (mount/start #'app.conf/config #'app.www/web-server)
INFO app.conf - loading config from dev/resources/config.edn
23:41:32.078 [nREPL-worker-0] DEBUG o.e.jetty.util.component.Container - Container org.eclipse.jetty.server.Server@53ec06fb + SelectChannelConnector@0.0.0.0:4242 as connector
...
23:41:32.116 [nREPL-worker-0] DEBUG o.e.j.u.component.AbstractLifeCycle - STARTED org.eclipse.jetty.server.Server@53ec06fb
{:started ["#'app.conf/config" "#'app.www/web-server"]}
dev=>
stopping it:
dev=> (mount/stop #'app.www/web-server)
23:41:37.690 [nREPL-worker-0] DEBUG o.e.j.u.component.AbstractLifeCycle - stopping org.eclipse.jetty.server.Server@53ec06fb
...
23:41:37.775 [nREPL-worker-0] DEBUG o.e.j.u.component.AbstractLifeCycle - STOPPED org.eclipse.jetty.server.Server@53ec06fb
{:stopped ["#'app.www/web-server"]}
dev=>