MCPcopy Index your code
hub / github.com/fastapi/fastapi / add_frontend_route

Method add_frontend_route

fastapi/routing.py:2082–2097  ·  view source on GitHub ↗
(
        self,
        path: str,
        *,
        directory: str | os.PathLike[str],
        fallback: Literal["auto", "index.html", "404.html"] | None = "auto",
        check_dir: bool = True,
    )

Source from the content-addressed store, hash-verified

2080 )
2081
2082 def add_frontend_route(
2083 self,
2084 path: str,
2085 *,
2086 directory: str | os.PathLike[str],
2087 fallback: Literal["auto", "index.html", "404.html"] | None = "auto",
2088 check_dir: bool = True,
2089 ) -> None:
2090 self.routes.append(
2091 _FrontendRoute(
2092 path,
2093 directory=directory,
2094 fallback=fallback,
2095 check_dir=check_dir,
2096 )
2097 )
2098
2099 def matches(self, scope: Scope) -> tuple[Match, Scope]:
2100 match, child_scope, _ = self._match(scope, prefix="")

Callers 1

frontendMethod · 0.80

Calls 1

_FrontendRouteClass · 0.85

Tested by

no test coverage detected