A simple serve
task to start/stop Immutant2 for use with the boot build tool. Based almost entirely on Murphy McMahon's boot-http.
(The following assumes you have boot installed and updated.)
This starts Immutant2 at root url path ("/") and port 3000:
boot -d mbuczko/boot-immutant2 serve -b
By default, the serve task doesn't block, so it can be chained with other tasks in a pipeline. However if you just want to serve files, you need to block to keep the task from exiting immediately. You can do this with the -b or --block flags, as above.
In your build.boot
, add [mbuczko/boot-immutant2 "0.1.0"]
to :dependencies and
(require '[mbuczko.immutant2 :refer :all])
. Then the command is shorter:
boot serve -b
You can set the directory and port to serve on, too:
boot serve -d target -p 8888 -b
Once included in build.boot
as a dependency, all the serve
task's options can be inspected:
boot serve -h
The boot guys basically wrote all of this or walked me through any parts I had to change. Thanks!
Copyright © 2014 Michal Buczko
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.