weavejester / lein-ring

Ring plugin for Leiningen
Eclipse Public License 1.0
501 stars 100 forks source link

Forward a :bind option for starting a repl as well #161

Closed gfredericks closed 9 years ago

gfredericks commented 9 years ago

This is particularly useful when running inside a docker container, as binding to localhost precludes exposing the port outside the container.

MichaelBlume commented 9 years ago

Nice, thanks

weavejester commented 9 years ago

I think this option should be :host rather than :bind, in order to be consistent with :repl-options, and because :host is the more usual name.

MichaelBlume commented 9 years ago

Yeah, good idea, I'll fix it

MichaelBlume commented 9 years ago

Wait, actually I'm confused, in order to be consistent with which?

weavejester commented 9 years ago

The :repl-options key in Leiningen uses :host rather than :bind (sample.project.clj). Because our :nrepl key similarly opens a connection to an nrepl server, we should probably use the same keys where it makes sense to do so.

MichaelBlume commented 9 years ago

Ah, yep, makes sense.

It's annoying because tools.nrepl actually does use the :bind key, but I think it makes more sense to emulate the leiningen options.

On Thu, May 14, 2015 at 10:45 AM James Reeves notifications@github.com wrote:

The :repl-options key in Leiningen uses :host rather than :bind ( sample.project.clj https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L353). Because our :nrepl key similarly opens a connection to an nrepl server, we should probably use the same keys where it makes sense to do so.

— Reply to this email directly or view it on GitHub https://github.com/weavejester/lein-ring/pull/161#issuecomment-102114879 .

gfredericks commented 9 years ago

While we're at it is there any sensible way to respect the top-level :repl-options key?

E.g., I'm pretty sure that if the user has custom middleware or anything like that it won't end up being used?

I haven't reviewed the code again though so I might have missed a detail.