We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9af605b commit 6883de1Copy full SHA for 6883de1
src/foxops/__main__.py
@@ -67,6 +67,17 @@ def create_app():
67
name=f"ui-{frontend_dir}",
68
)
69
70
+ robot_file = settings.frontend_dist_dir / "robots.txt"
71
+
72
+ if robot_file.exists():
73
74
+ @app.get("/robots.txt", include_in_schema=False)
75
+ async def _serve_robots_txt():
76
+ return FileResponse(robot_file)
77
78
+ else:
79
+ logger.warning("The robots.txt file does not exist, skipping ...")
80
81
@app.get("/{full_path:path}", include_in_schema=False)
82
async def _(full_path: str):
83
"""Serve the frontend."""
ui/public/robots.txt
@@ -0,0 +1,2 @@
1
+User-agent: *
2
+Disallow: /
0 commit comments