Commit 798343dd authored by Jaden DIEFENBAUGH's avatar Jaden DIEFENBAUGH
Browse files

[server] add "--dev" flag for not opening browser tab on start

parent a2e53996
......@@ -28,7 +28,7 @@
"""Starts the BEAT editor
Usage: %(prog)s [-v...] [--debug] [--prefix=<path>] [--cache=<path>]
Usage: %(prog)s [-v...] [--debug] [--prefix=<path>] [--cache=<path>] [--dev]
%(prog)s --help
%(prog)s --version
......@@ -42,6 +42,8 @@ Options:
it goes along.
-d, --debug Use the debug version of the javascript source to
launch the editor
--dev Use the development version, which doesn't open a new
web browser tab.
-p, --prefix=<path> Overrides the prefix of your local data. If not set use
the value from your RC file
[default: %(prefix)s]
......@@ -120,14 +122,14 @@ def main(user_input=None):
api.add_resource(Templates, '/templates', resource_class_kwargs={'config': config})
api.add_resource(Environments, '/environments')
for entity in VALID_ENTITIES:
api.add_resource(gen_endpoint(entity), '/' + entity,
resource_class_kwargs={'config': config})
# open the browser tab right before starting the server
# the latency of opening the tab will keep us from getting 404s
import webbrowser'http://localhost:5000/')
if not args['--dev']:
import webbrowser'http://localhost:5000/')['--debug'])
Supports Markdown
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