Support root path from environment

This commit is contained in:
2026-05-20 11:36:44 +02:00
parent b23e63ca90
commit 056728a511
+8 -4
View File
@@ -1,11 +1,14 @@
import os
from fastapi import FastAPI
APP_NAME = "Python FastAPI Template"
APP_VERSION = "1.0.0"
APP_NAME = os.getenv("APP_NAME", "Python FastAPI Template")
APP_VERSION = os.getenv("APP_VERSION", "1.0.0")
ROOT_PATH = os.getenv("ROOT_PATH", "")
app = FastAPI(
title=APP_NAME,
version=APP_VERSION
version=APP_VERSION,
root_path=ROOT_PATH
)
@app.get("/health")
@@ -17,5 +20,6 @@ def version():
return {
"app": APP_NAME,
"version": APP_VERSION,
"language": "python"
"language": "python",
"root_path": ROOT_PATH
}