Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting :ip and :port from gorilla-options. #5

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/leiningen/gorilla.clj
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
(defn gorilla
[project & opts]
(let [opts-map (apply hash-map opts)
port (read-string (or (get opts-map ":port") "0"))
ip (or (get opts-map ":ip") "127.0.0.1")
gorilla-options (:gorilla-options project)
port (or (:port gorilla-options) (read-string (or (get opts-map ":port") "0")))
ip (or (:ip gorilla-options) (get opts-map ":ip") "127.0.0.1")
nrepl-port (read-string (or (get opts-map ":nrepl-port") "0"))
;; inject the gorilla-repl dependency into the target project
curr-deps (or (:dependencies project) [])
new-deps (conj curr-deps ['gorilla-repl/gorilla-repl gorilla-version])
prj (assoc project :dependencies new-deps)
project-name (:name project)
gorilla-options (:gorilla-options project)]
project-name (:name project)]
(eval/eval-in-project
prj
`(g/run-gorilla-server {:port ~port
Expand Down