Robert Brennan cac3b6d7f7
Refactor listen.py (#5281)
Co-authored-by: sp.wack <83104063+amanape@users.noreply.github.com>
2024-11-26 17:57:24 +00:00

11 lines
379 B
Python

from fastapi.staticfiles import StaticFiles
class SPAStaticFiles(StaticFiles):
async def get_response(self, path: str, scope):
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)