use production mode switch for reloading
This commit is contained in:
parent
7a0925d60f
commit
09b7d59b39
2 changed files with 6 additions and 3 deletions
5
api/.vscode/launch.json
vendored
5
api/.vscode/launch.json
vendored
|
@ -9,7 +9,10 @@
|
|||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "ovdashboard_api.main",
|
||||
"justMyCode": true
|
||||
"justMyCode": true,
|
||||
"env": {
|
||||
"PRODUCTION_MODE": "false"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
|
@ -9,8 +9,8 @@ Creates the main `FastAPI` app.
|
|||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
|
||||
from .settings import SETTINGS
|
||||
from .routers import main_router
|
||||
from .settings import SETTINGS
|
||||
|
||||
app = FastAPI(
|
||||
title="OVDashboard API",
|
||||
|
@ -36,7 +36,7 @@ def main() -> None:
|
|||
app="ovdashboard_api.main:app",
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
reload=True,
|
||||
reload=not SETTINGS.production_mode,
|
||||
)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue