Skip to content

Commit a7e74a2

Browse files
committed
feat: Fetch PORT from env vars
1 parent 34e0209 commit a7e74a2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/register_ticket_api/main.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import os
2+
13
from fastapi import FastAPI
24

35
from register_ticket_api.controllers import TicketsController
@@ -18,4 +20,4 @@
1820
if __name__ == "__main__": # pragma: no cover
1921
import uvicorn
2022

21-
uvicorn.run(app, host="0.0.0.0", port=8000) # noqa S104
23+
uvicorn.run(app, host="0.0.0.0", port=int(os.getenv("PORT", "8080"))) # noqa S104

0 commit comments

Comments
 (0)