Update templates for fastapi_vue 0.5.0 catch-all toggle.

This commit is contained in:
2026-01-25 01:07:56 +00:00
parent 1d9ddf7dc5
commit f5fcd626e8
2 changed files with 4 additions and 7 deletions
+2 -3
View File
@@ -51,9 +51,7 @@ PYPROJECT_ADDITIONS = {
# Frontend instantiation block for patching existing apps
FRONTEND_BLOCK = """
# Vue Frontend static files
frontend = Frontend(
Path(__file__).with_name("frontend-build"), spa=True, cached=["/assets/"]
)
frontend = Frontend(Path(__file__).with_name("frontend-build"), cached=["/assets/"])
"""
# TypeScript health check script for Vue components
@@ -390,6 +388,7 @@ def patch_app_file(
# Append route at end
lines.append("")
lines.append("# Serve the Vue frontend (needs to be last if SPA catch-all is used)")
lines.append(route_line)
content = "\n".join(lines)
+2 -4
View File
@@ -5,9 +5,7 @@ from fastapi import FastAPI
from fastapi_vue import Frontend
# Vue Frontend static files
frontend = Frontend(
Path(__file__).with_name("frontend-build"), spa=True, cached=["/assets/"]
)
frontend = Frontend(Path(__file__).with_name("frontend-build"), cached=["/assets/"])
@asynccontextmanager
@@ -29,5 +27,5 @@ async def health_check():
return {"status": "ok"}
# Final catch-all route for frontend files (keep at end of file)
# Serve the Vue frontend (needs to be last if SPA catch-all is used)
frontend.route(app, "/")