semantic update
This commit is contained in:
@@ -241,6 +241,10 @@ frontend_path = project_root / "frontend" / "build"
|
||||
if frontend_path.exists():
|
||||
app.mount("/_app", StaticFiles(directory=str(frontend_path / "_app")), name="static")
|
||||
|
||||
# [DEF:serve_spa:Function]
|
||||
# @PURPOSE: Serves the SPA frontend for any path not matched by API routes.
|
||||
# @PRE: frontend_path exists.
|
||||
# @POST: Returns the requested file or index.html.
|
||||
@app.get("/{file_path:path}", include_in_schema=False)
|
||||
async def serve_spa(file_path: str):
|
||||
# Only serve SPA for non-API paths
|
||||
|
||||
@@ -18,3 +18,4 @@ def __getattr__(name):
|
||||
from .resource_service import ResourceService
|
||||
return ResourceService
|
||||
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
||||
# [/DEF:backend.src.services:Module]
|
||||
|
||||
Reference in New Issue
Block a user