Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(style): use nmdc favicon #493

Merged
merged 1 commit into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion nmdc_runtime/api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from fastapi.staticfiles import StaticFiles
from setuptools_scm import get_version
from starlette import status
from starlette.responses import RedirectResponse, HTMLResponse
from starlette.responses import RedirectResponse, HTMLResponse, FileResponse

from nmdc_runtime.api.analytics import Analytics
from nmdc_runtime.util import (
Expand Down Expand Up @@ -453,6 +453,11 @@ async def get_versions():
)


@app.get("/favicon.ico")
async def favicon():
return FileResponse("static/favicon.ico")


@app.get("/docs", include_in_schema=False)
def custom_swagger_ui_html(
user_id_token: Annotated[str | None, Cookie()] = None,
Expand Down Expand Up @@ -490,6 +495,7 @@ def custom_swagger_ui_html(
oauth2_redirect_url=app.swagger_ui_oauth2_redirect_url,
swagger_js_url="https://cdn.jsdelivr.net/npm/[email protected]/swagger-ui-bundle.js",
swagger_css_url="https://cdn.jsdelivr.net/npm/[email protected]/swagger-ui.css",
swagger_favicon_url="/static/favicon.ico",
swagger_ui_parameters=swagger_ui_parameters,
)
content = (
Expand Down
Binary file added nmdc_runtime/static/favicon.ico
Binary file not shown.
Loading