SEO improvements
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m0s

This commit is contained in:
Tudor
2026-01-08 11:47:38 +00:00
parent 71b05769ae
commit 0aafdfa382
5 changed files with 98 additions and 0 deletions

View File

@@ -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")