Skip to content

Commit d3963cf

Browse files
Update dev.py
1 parent 46bffe7 commit d3963cf

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

  • {{cookiecutter.project_name}}

{{cookiecutter.project_name}}/dev.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,19 @@
1818

1919
if __name__ == "__main__":
2020
os.environ["APP_ENV"] = "dev"
21+
port = int(os.environ.get("APP_PORT", 8000))
2122

2223
console = Console()
2324
console.rule("[bold yellow]Running for local development", align="left")
24-
{%- if cookiecutter.use_openapi == "True" %}
25+
{%- if cookiecutter.use_openapi %}
2526
console.print("[bold yellow]Visit http://localhost:8000/docs")
2627
{%- endif %}
2728

28-
uvicorn.run("app.main:app", host="localhost", lifespan="on", log_level="info", reload=True)
29+
uvicorn.run(
30+
"app.main:app",
31+
host="localhost",
32+
port=port,
33+
lifespan="on",
34+
log_level="info",
35+
reload=True,
36+
)

0 commit comments

Comments
 (0)