We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Uvicorn server port is currently hardcoded in main.py:
main.py
if __name__ == "__main__": uvicorn.run("main:app", port=7001, reload=True)
This configuration should be moved to an environment file (e.g., .env) to make it more flexible and configurable.
env
PORT
.env
env.sample
PORT=7001
Settings
api/utils/settings.py
class Settings(BaseSettings): PORT: int = 7001 # Default value if not set in .env
from api.utils.settings import settings if __name__ == "__main__": uvicorn.run("main:app", port=settings.PORT, reload=True)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
The Uvicorn server port is currently hardcoded in
main.py
:This configuration should be moved to an environment file (e.g., .
env
) to make it more flexible and configurable.Proposed Changes
PORT
variable to the.env
file (updateenv.sample
as well:Settings
class (api/utils/settings.py
):main.py
to read the port from the environment file:Acceptance Criteria:
PORT
variable is defined in the.env
file.main.py
file reads the port from the environment..env
file.The text was updated successfully, but these errors were encountered: