diff --git a/tests/test_cli.py b/tests/test_cli.py index 2d67b25..08c69af 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -24,7 +24,7 @@ def test_cli_server_dev(MockApplication): MockApplication.assert_called_once_with( { - "bind": "127.0.0.1:8000", + "bind": "0.0.0.0:8000", "reload": True, } ) diff --git a/teufa/cli.py b/teufa/cli.py index 7403a62..bc6529b 100644 --- a/teufa/cli.py +++ b/teufa/cli.py @@ -1,3 +1,4 @@ +import os import sys import click @@ -14,8 +15,9 @@ def cli(): @cli.command() @click.option("--dev/--no-dev", default=False) def server(dev): + port = os.environ.get("PORT", 8000) cfg = { - "bind": "127.0.0.1:8000", + "bind": f"0.0.0.0:{port}", "reload": dev, } teufa.server.Application(cfg).run()