Add fallback file

This commit is contained in:
Matthias
2021-01-16 10:27:15 +01:00
parent f05f2c45e8
commit e928d2991d
3 changed files with 36 additions and 2 deletions

View File

@@ -24,5 +24,8 @@ async def index_html(rest_of_path: str):
if (uibase / rest_of_path).is_file():
return FileResponse(uibase / rest_of_path)
index_file = uibase / 'index.html'
if not index_file.is_file():
return FileResponse(uibase / 'fallback_file.html')
# Fall back to index.html, as indicated by vue router docs
return FileResponse(uibase / 'index.html')
return FileResponse(index_file)