slush-marklogic-node
slush-marklogic-node copied to clipboard
feature request: automatically choose an open port for ML
from marklogic/roxy#540:
If port 8040
is taken, the default generated app can't be bootstrapped without config changes, which can be unintuitive. If there's a local MarkLogic instance available when the app is generated, do we want to try to choose open ports.
That could be done without interaction with ML, if just run netstat
or somesuch ...
netstat assumes ML is on localhost. Often this is not the case.
If there's a local MarkLogic instance available when the app is generated
;)
It shouldn't be too difficult to just try to connect to host:port (with a blunt http get for instance), and see if that fails or not. I think I once wrote something similar in XQuery. Probably not perfect either, but seemed to work reasonably well..
How about not doing it fully automatic, but connect to host:port selected by user, and warn if it looks like it is being used during questioning, and repeating port question until a free port was selected (or optionally an option to force continuing)..