Method
add_frontend_route
(
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="") |
Tested by
no test coverage detected