Use favicon
This commit is contained in:
parent
378047e622
commit
bf7982c56b
4 changed files with 20 additions and 8 deletions
|
|
@ -2,7 +2,7 @@ from pathlib import Path
|
|||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.wsgi import WSGIMiddleware
|
||||
from fastapi.responses import RedirectResponse
|
||||
from fastapi.responses import FileResponse, RedirectResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
from ...constants import DASHBOARD_PATH
|
||||
|
|
@ -14,6 +14,11 @@ PATH = Path(__file__).parent.resolve()
|
|||
def bootstrap_dashboard(app: FastAPI, function_name: str, documentation: str) -> None:
|
||||
dash_app = create_dash_app(function_name, app.version, documentation)
|
||||
|
||||
@app.get("/favicon.ico")
|
||||
@app.get(f"{DASHBOARD_PATH}/_favicon.ico")
|
||||
def get_favicon() -> FileResponse:
|
||||
return FileResponse(PATH / "dashboard/assets/favicon.ico")
|
||||
|
||||
app.mount(DASHBOARD_PATH, WSGIMiddleware(dash_app))
|
||||
|
||||
@app.get("/", include_in_schema=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue