Skip to content

Commit

Permalink
Fix issue in server URL
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl committed Jun 11, 2024
1 parent 1329ab1 commit f4a208a
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions weatherman/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
logging.basicConfig(level=logging.INFO)

host = environ.get("DOMAIN", "localhost")
port = 9000
port = 8000
protocol = "http" if host == "localhost" else "https"

app = FastAPI(
servers=[
{"url": f"{protocol}://{host}:{port}", "description": "Weather app server"}
]
base_url = (
f"{protocol}://{host}:{port}" if host == "localhost" else f"{protocol}://{host}"
)

app = FastAPI(servers=[{"url": base_url, "description": "Weather app server"}])


class HourlyForecast(BaseModel):
forecast_time: datetime.time
Expand Down

0 comments on commit f4a208a

Please sign in to comment.