We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5fefca5 commit 4ae9283Copy full SHA for 4ae9283
tests/test_cli.py
@@ -24,7 +24,7 @@ def test_cli_server_dev(MockApplication):
24
25
MockApplication.assert_called_once_with(
26
{
27
- "bind": "127.0.0.1:8000",
+ "bind": "0.0.0.0:8000",
28
"reload": True,
29
}
30
)
teufa/cli.py
@@ -1,3 +1,4 @@
1
+import os
2
import sys
3
4
import click
@@ -14,8 +15,9 @@ def cli():
14
15
@cli.command()
16
@click.option("--dev/--no-dev", default=False)
17
def server(dev):
18
+ port = os.environ.get("PORT", 8000)
19
cfg = {
20
+ "bind": f"0.0.0.0:{port}",
21
"reload": dev,
22
23
teufa.server.Application(cfg).run()
0 commit comments