Skip to content

Commit

Permalink
Merge c8be0e9 into 2615c9a
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonTam committed Nov 29, 2017
2 parents 2615c9a + c8be0e9 commit 4690f26
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions sacredboard/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"File Storage observer. (experimental)")
@click.option("--no-browser", is_flag=True, default=False,
help="Do not open web browser automatically.")
@click.option("--port", default="5000", type=int,
help="Run the app on a different port.")
@click.option("--sub-url", default="/",
help="Run the app on a sub-url. Example '-sub_url /sacredboard/' "
"maps localhost:5000/ -> localhost:5000/sacredboard/. "
Expand All @@ -52,7 +54,7 @@
help="Run the application in Flask debug mode "
"(for development).")
@click.version_option()
def run(debug, no_browser, m, mu, mc, f, sub_url):
def run(debug, no_browser, m, mu, mc, f, port, sub_url):
"""
Sacredboard.
Expand All @@ -68,6 +70,11 @@ def run(debug, no_browser, m, mu, mc, f, sub_url):
a local MongoDB database called 'sacred'. Opens web browser.
Note: MongoDB must be listening on localhost.
\b
sacredboard -m sacred --port 9000
Starts Sacredboard on non- default port 9000 and connects to
a local MongoDB database called 'sacred'. Opens web browser.
Note: MongoDB must be listening on localhost.
\b
sacredboard -m 192.168.1.1:27017:sacred
Starts Sacredboard on default port (5000) and connects to
a MongoDB database running on 192.168.1.1 on port 27017
Expand Down Expand Up @@ -111,7 +118,7 @@ def run(debug, no_browser, m, mu, mc, f, sub_url):
if debug:
app.run(host="0.0.0.0", debug=True)
else:
for port in range(5000, 5050):
for port in range(port, port + 50):
http_server = WSGIServer(('0.0.0.0', port), app)
try:
http_server.start()
Expand Down

0 comments on commit 4690f26

Please sign in to comment.