feat: configurable STATIC_DIR; fix: mount CACHE_DIR to the /cache endpoint

This commit is contained in:
shivaraj-bh
2024-04-09 16:02:28 +05:30
parent 331fe04df7
commit 304bf9d9b1
2 changed files with 25 additions and 20 deletions

View File

@@ -38,6 +38,8 @@ from config import (
VERSION,
CHANGELOG,
FRONTEND_BUILD_DIR,
CACHE_DIR,
STATIC_DIR,
MODEL_FILTER_ENABLED,
MODEL_FILTER_LIST,
GLOBAL_LOG_LEVEL,
@@ -282,7 +284,6 @@ async def get_app_latest_release_version():
detail=ERROR_MESSAGES.RATE_LIMIT_EXCEEDED,
)
@app.get("/manifest.json")
async def get_manifest_json():
return {
@@ -296,10 +297,8 @@ async def get_manifest_json():
"icons": [{"src": "/favicon.png", "type": "image/png", "sizes": "844x884"}],
}
app.mount("/static", StaticFiles(directory="static"), name="static")
app.mount("/cache", StaticFiles(directory="data/cache"), name="cache")
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
app.mount("/cache", StaticFiles(directory=CACHE_DIR), name="cache")
app.mount(
"/",