From e0b5a55ccc5e00d6e7db445a313de1a2c588b04f Mon Sep 17 00:00:00 2001 From: Davide Scaini Date: Fri, 1 May 2026 22:20:19 +0200 Subject: [PATCH] fix(dev): pass --host 0.0.0.0 to astro dev when --mobile, print LAN URL --- bincio/dev.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bincio/dev.py b/bincio/dev.py index 06e2ef4..da1ae36 100644 --- a/bincio/dev.py +++ b/bincio/dev.py @@ -205,7 +205,10 @@ def dev( console.print(f" Mobile: [bold cyan]{mobile_url}[/bold cyan] ← set this as instance URL in the app") else: console.print(f" Auth: [yellow]none[/yellow] (single-user, no instance.db)") - console.print(f" Browser: [cyan]http://localhost:{port}[/cyan]") + if api_host == "0.0.0.0": + console.print(f" Browser: [bold cyan]http://{lan_ip}:{port}[/bold cyan] ← open this on mobile") + else: + console.print(f" Browser: [cyan]http://localhost:{port}[/cyan]") console.print() _ensure_npm(site) @@ -255,10 +258,9 @@ def dev( console.print(f"Starting [cyan]astro dev[/cyan] on port {port}…") console.print() try: - subprocess.run( - ["npm", "run", "dev", "--", "--port", str(port)], - cwd=site, - env=env, - ) + astro_cmd = ["npm", "run", "dev", "--", "--port", str(port)] + if api_host == "0.0.0.0": + astro_cmd += ["--host", "0.0.0.0"] + subprocess.run(astro_cmd, cwd=site, env=env) except KeyboardInterrupt: pass