Skip to content

Commit

Permalink
Pass filename on URL open from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
banesullivan committed Jul 20, 2022
1 parent 5b1f6eb commit 165de5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion localtileserver/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
@click.option("-d", "--debug", default=False)
@click.option("-b", "--browser", default=True)
@click.option("-t", "--cesium-token", default="")
@click.option("-h", "--host", default="127.0.0.1")
@click.option("-c", "--cors-all", default=False)
def run_app(
filename,
Expand Down Expand Up @@ -68,7 +69,7 @@ def run_app(
port = sock.getsockname()[1]
sock.close()

url = f"http://{host}:{port}"
url = f"http://{host}:{port}?filename={filename}"
if browser:
threading.Timer(1, lambda: webbrowser.open(url)).start()
app.run(host=host, port=port, debug=debug)
Expand Down

0 comments on commit 165de5d

Please sign in to comment.