Added auth
This commit is contained in:
14
routers/frontend.py
Normal file
14
routers/frontend.py
Normal file
@ -0,0 +1,14 @@
|
||||
import typing
|
||||
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
|
||||
class SPAStaticFiles(StaticFiles):
|
||||
async def get_response(self, path: str, scope: typing.Any):
|
||||
response = await super().get_response(path, scope)
|
||||
|
||||
# Default back to `index.html` for our SPA
|
||||
if response.status_code == 404:
|
||||
response = await super().get_response(".", scope)
|
||||
|
||||
return response
|
Reference in New Issue
Block a user