SEO improvements
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m0s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m0s
This commit is contained in:
@@ -584,6 +584,23 @@ async def reload_data(
|
||||
return {"status": "reloaded"}
|
||||
|
||||
|
||||
# =============================================================================
|
||||
# SEO FILES
|
||||
# =============================================================================
|
||||
|
||||
|
||||
@app.get("/robots.txt")
|
||||
async def robots_txt():
|
||||
"""Serve robots.txt for search engine crawlers."""
|
||||
return FileResponse(settings.frontend_dir / "robots.txt", media_type="text/plain")
|
||||
|
||||
|
||||
@app.get("/sitemap.xml")
|
||||
async def sitemap_xml():
|
||||
"""Serve sitemap.xml for search engine indexing."""
|
||||
return FileResponse(settings.frontend_dir / "sitemap.xml", media_type="application/xml")
|
||||
|
||||
|
||||
# Mount static files directly (must be after all routes to avoid catching API calls)
|
||||
if settings.frontend_dir.exists():
|
||||
app.mount("/static", StaticFiles(directory=settings.frontend_dir), name="static")
|
||||
|
||||
Reference in New Issue
Block a user