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

chore(client): fix mypy lint #3097

Merged
merged 1 commit into from
Dec 27, 2023
Merged
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
5 changes: 2 additions & 3 deletions client/starwhale/web/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from starlette.requests import Request
from starlette.responses import Response, FileResponse, StreamingResponse
from starlette.background import BackgroundTask
from starlette.exceptions import HTTPException
from starlette.staticfiles import StaticFiles

from starwhale.web import user, panel, system, project, data_store
Expand All @@ -31,14 +30,14 @@ def add_component(self, component: Component) -> None:

@classmethod
def mount_static(cls, app: FastAPI) -> FastAPI:
def index() -> FileResponse:
def index(_: Request) -> FileResponse:
return FileResponse(os.path.join(STATIC_DIR_DEV, "index.html"))

app.add_route("/", index, methods=["GET"])
app.mount("/", StaticFiles(directory=STATIC_DIR_DEV), name="assets")

def not_found_exception_handler(
request: Request, exc: HTTPException
request: Request, exc: Exception
) -> FileResponse:
return FileResponse(os.path.join(STATIC_DIR_DEV, "index.html"))

Expand Down
Loading