add PORT env override
This commit is contained in:
parent
5fefca50a7
commit
4ae92830db
@ -24,7 +24,7 @@ def test_cli_server_dev(MockApplication):
|
|||||||
|
|
||||||
MockApplication.assert_called_once_with(
|
MockApplication.assert_called_once_with(
|
||||||
{
|
{
|
||||||
"bind": "127.0.0.1:8000",
|
"bind": "0.0.0.0:8000",
|
||||||
"reload": True,
|
"reload": True,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import click
|
import click
|
||||||
@ -14,8 +15,9 @@ def cli():
|
|||||||
@cli.command()
|
@cli.command()
|
||||||
@click.option("--dev/--no-dev", default=False)
|
@click.option("--dev/--no-dev", default=False)
|
||||||
def server(dev):
|
def server(dev):
|
||||||
|
port = os.environ.get("PORT", 8000)
|
||||||
cfg = {
|
cfg = {
|
||||||
"bind": "127.0.0.1:8000",
|
"bind": f"0.0.0.0:{port}",
|
||||||
"reload": dev,
|
"reload": dev,
|
||||||
}
|
}
|
||||||
teufa.server.Application(cfg).run()
|
teufa.server.Application(cfg).run()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user