Update config structure and enhance file handling

Renamed API_V1_STR to API_VERSION_STR for consistency. Introduced 'UPLOAD_FOLDER' and ensured its creation, added logging for the data directory path, and implemented allowed image content type validation. Adjusted related references in `main.py`.
This commit is contained in:
2025-03-12 18:35:42 +01:00
parent 5ad886a53e
commit e27e2b75ee
2 changed files with 19 additions and 4 deletions

View File

@@ -17,7 +17,7 @@ logger.info(f"Starting app!!!")
app = FastAPI(
title=settings.PROJECT_NAME,
version=settings.VERSION,
openapi_url=f"{settings.API_V1_STR}/openapi.json"
openapi_url=f"{settings.API_VERSION_STR}/openapi.json"
)
# Set up CORS middleware
@@ -46,5 +46,5 @@ async def root():
"""
app.include_router(api_router, prefix=settings.API_V1_STR)
app.include_router(api_router, prefix=settings.API_VERSION_STR)
app.mount("/files", StaticFiles(directory=settings.DATA_FILES_DIR), name="static")