Commit 2bc6f922 authored by Patrick Godwin's avatar Patrick Godwin

serve.py: expose hostname, port as CLI options

parent c20d017d
Pipeline #113035 failed with stages
in 3 minutes and 29 seconds
......@@ -519,6 +519,10 @@ def config_to_consumer(config):
def _add_parser_args(parser):
parser.add_argument('-b', '--backend', default='wsgiref',
help="chooses server backend. options: [cgi|wsgiref]. default=wsgiref.")
parser.add_argument('-p', '--port', type=int, default=8086,
help="select port to serve content on server. default = 8086")
parser.add_argument('--hostname', default='localhost',
help="select hostname to serve content on server. default = localhost.")
parser.add_argument('-c', '--config',
help="sets dashboard/plot options based on yaml configuration. if not set, uses SCALDRC_PATH.")
parser.add_argument('-e', '--with-cgi-extension', default=False, action='store_true',
......@@ -540,6 +544,8 @@ def main(args=None):
args = parser.parse_args()
### parse args and set up configuration
port = args.port
hostname = args.hostname
server_backend = args.backend
app_name = args.application_name
......@@ -562,4 +568,7 @@ def main(args=None):
app.config.update({'script_name': script_name, 'use_cgi': use_cgi})
### start server
bottle.run(app, server=server_backend, debug=True)
if use_cgi:
bottle.run(app, server=server_backend, debug=True)
else:
bottle.run(app, server=server_backend, host=hostname, port=port, debug=True)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment