luminus-framework / luminus-nrepl

nREPL server for Luminus
Eclipse Public License 1.0
4 stars 2 forks source link

Allow caller to specify clojure.tools.nrepl.server/start-server options #2

Closed novakboskov closed 8 years ago

novakboskov commented 8 years ago
(defn cider&cljr-nrepl-handler []
      (apply nrepl/default-handler (cons #'refactor-nrepl.middleware/wrap-refactor
                                          (map resolve cider-middleware))))
...
(defn start-app
  "e.g. lein run 3000"
  [[port]]
  (let [port (http-port port)]
    (.addShutdownHook (Runtime/getRuntime) (Thread. stop-app))
    (when-let [repl-port (env :nrepl-port)]
      (repl/start (parse-port repl-port) :handler (cider&cljr-nrepl-handler)))
    (http/start {:handler app
                 :init    init
                 :port    port})))
yogthos commented 8 years ago

thanks, looks great

yogthos commented 8 years ago

I just pushed out the new template, I ended up changing the params to be a map to keep it consistent with the HTTP server adapters:

(repl/start {:port (parse-port repl-port)
             :handler (cider&cljr-nrepl-handler)}))