mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 13:52:43 +08:00
Co-authored-by: openhands <openhands@all-hands.dev> Co-authored-by: Rohit Malhotra <rohitvinodmalhotra@gmail.com>
13 lines
473 B
Python
13 lines
473 B
Python
from fastapi.staticfiles import StaticFiles
|
|
from starlette.responses import Response
|
|
from starlette.types import Scope
|
|
|
|
|
|
class SPAStaticFiles(StaticFiles):
|
|
async def get_response(self, path: str, scope: Scope) -> Response:
|
|
try:
|
|
return await super().get_response(path, scope)
|
|
except Exception:
|
|
# FIXME: just making this HTTPException doesn't work for some reason
|
|
return await super().get_response('index.html', scope)
|