dev: add --lan flag to dev.py to expose the dev server on the network
Typing SOULSYNC_WEB_BIND_HOST=0.0.0.0 every launch is awkward. `python dev.py --lan` sets it for you (binds 0.0.0.0 so other devices can reach it); plain `python dev.py` stays localhost-only. Set before build_backend_env() so it propagates to both the direct (Windows) and gunicorn backend modes.
This commit is contained in:
parent
a8206012ae
commit
31ebe96f76
1 changed files with 8 additions and 0 deletions
8
dev.py
8
dev.py
|
|
@ -316,6 +316,14 @@ def watch_and_run_backend() -> None:
|
|||
|
||||
|
||||
def main() -> int:
|
||||
# `--lan` exposes the dev server on the network (binds 0.0.0.0) so you can
|
||||
# reach it from another device at http://<this-pc-ip>:8008. Default stays
|
||||
# localhost-only. Set before build_backend_env() so both backend modes see it.
|
||||
if '--lan' in sys.argv:
|
||||
os.environ['SOULSYNC_WEB_BIND_HOST'] = '0.0.0.0'
|
||||
print('LAN mode ON — dev server reachable from other devices on your network '
|
||||
'(http://<this-pc-ip>:8008). Allow port 8008 through the firewall if needed.')
|
||||
|
||||
if not (ROOT_DIR / 'webui' / 'node_modules').is_dir():
|
||||
print('webui/node_modules is missing.')
|
||||
print('Run: cd webui && npm ci')
|
||||
|
|
|
|||
Loading…
Reference in a new issue