graphinate.server.starlette.views.favicon_route()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nop 0
1
import functools
2
3
from starlette.requests import Request
4
from starlette.responses import FileResponse
5
from starlette.routing import Route
6
7
from ..web import get_static_path
8
9
10
def favicon(request: Request) -> FileResponse:
11
    path = get_static_path('images/logo-128.png').absolute().as_posix()
12
    return FileResponse(path)
13
14
15
@functools.cache
16
def favicon_route() -> Route:
17
    return Route('/favicon.ico', endpoint=favicon, include_in_schema=False)
18