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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user