Liking cljdoc? Tell your friends :D

env-repl

A Component that will start/stop REPL servers based on environment variables.

Usage

Clojars: https://clojars.org/worldsingles/env-repl

Leiningen / Boot Dependency:

[worldsingles/env-repl "0.2.1"]

Start the REPL with CIDER dependencies (if available), and environment variables defining the PORTs on which you want to run REPL:

DEV_REPL_PORT=6100 REPL_PORT=7100 boot -d cider/cider-nrepl -d refactor-nrepl repl

or:

DEV_REPL_PORT=6100 REPL_PORT=7100 clj -A:cider

Build and start the Component in the REPL:

(require '[ws.env-repl :as env-repl]
         '[com.stuartsierra.component :as component])

(def system (env-repl/system 'my-repl))
(alter-var-root #'system component/start)

If the CIDER dependencies are not available at runtime, a plain nREPL server will be started instead.

If you do not plan to start a DEV REPL, you do not need the CIDER dependencies. You can always start a Socket REPL:

(defn -main [& args]
  (component/start (component/system-map :repl (env-repl/system))))
REPL_PORT=54321 java -jar path/to/my-uberjar-0.1.0.jar

License

Copyright © 2016-2018 World Singles Networks llc.

Distributed under the Eclipse Public License version 1.0.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close