Last active
November 21, 2019 03:03
-
-
Save daveyarwood/d31d3fe25297377923b64bd814c4dc0e to your computer and use it in GitHub Desktop.
Dave's setup for starting a prepl server in Boot projects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; ~/.config/conjure/conjure.edn | |
{:conns | |
;; My `prepl-server` task spits out a `.socket-port` file when it starts a | |
;; prepl server. This configuration allows Conjure to find the prepl server | |
;; without needing to specify the port explicitly. | |
{:cwd {:port #slurp-edn ".socket-port"}}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Put this in your boot config file (mine lives at ~/.config/boot/profile.boot) | |
(deftask prepl-server | |
"Start a prepl server." | |
[p port PORT int "The port on which to start the prepl server (optional)."] | |
(comp | |
(socket-server | |
:accept 'clojure.core.server/io-prepl | |
:port port) | |
(wait))) | |
;; Worth noting: I contributed this task to Boot, and it got merged into the | |
;; master branch, so in some future release of Boot, `prepl-server` will be | |
;; available out of the box as a built-in task. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this in the root directory of any project with a build.boot | |
$ boot prepl-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment