Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f5fcd626e8 |
@@ -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)
|
||||
|
||||
|
||||
@@ -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, "/")
|
||||
|
||||
Reference in New Issue
Block a user