diff --git a/app/const.py b/app/const.py index 0aacda3..8f33d44 100644 --- a/app/const.py +++ b/app/const.py @@ -2,6 +2,7 @@ DB_URL = 'sqlite:////app/storage/was.db' DIR_ASSET = '/app/storage/asset' DIR_OTA = '/app/storage/ota' +FAVICON_PATH = '/app/static/favicon.ico' URL_WILLOW_RELEASES = 'https://worker.heywillow.io/api/release?format=was' URL_WILLOW_CONFIG = 'https://worker.heywillow.io/api/config' URL_WILLOW_TZ = 'https://worker.heywillow.io/api/asset?type=tz' diff --git a/app/main.py b/app/main.py index efade5f..90690ab 100644 --- a/app/main.py +++ b/app/main.py @@ -11,7 +11,7 @@ WebSocketDisconnect, ) from contextlib import asynccontextmanager -from fastapi.responses import RedirectResponse +from fastapi.responses import FileResponse, RedirectResponse from fastapi.staticfiles import StaticFiles import logging from pathlib import Path @@ -23,6 +23,7 @@ from app.const import ( ALEMBIC_CONFIG, DIR_OTA, + FAVICON_PATH, STORAGE_USER_CONFIG, ) @@ -159,6 +160,11 @@ def api_redirect_admin(): return "/admin" +@app.get('/favicon.ico', include_in_schema=False) +async def favicon(): + return FileResponse(FAVICON_PATH) + + app.include_router(asset.router) app.include_router(client.router) app.include_router(config.router)