Ali2206 commited on
Commit
97a08b6
·
1 Parent(s): 8e2c3a4

Add root routes to remaining agents (AIDual, AIFit, AIQuiz, AIRoute, AISaas, AIStrategy)

Browse files
AIDual/app/main.py CHANGED
@@ -153,6 +153,19 @@ app.add_middleware(
153
  router = APIRouter(prefix="/dual", tags=["dual"])
154
 
155
 
 
 
 
 
 
 
 
 
 
 
 
 
 
156
  @router.get("/health")
157
  def health() -> dict:
158
  return {"status": "ok", "openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL", "gpt-4o-mini")}
 
153
  router = APIRouter(prefix="/dual", tags=["dual"])
154
 
155
 
156
+ @router.get("/")
157
+ def index() -> FileResponse:
158
+ """Serve the AI Dual page."""
159
+ base = os.path.dirname(__file__)
160
+ return FileResponse(os.path.join(base, "static", "index.html"))
161
+
162
+ # Add route without trailing slash for compatibility
163
+ @router.get("")
164
+ def index_no_slash() -> FileResponse:
165
+ """Serve the AI Dual page (no trailing slash)."""
166
+ base = os.path.dirname(__file__)
167
+ return FileResponse(os.path.join(base, "static", "index.html"))
168
+
169
  @router.get("/health")
170
  def health() -> dict:
171
  return {"status": "ok", "openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL", "gpt-4o-mini")}
AIFit/app/main.py CHANGED
@@ -120,6 +120,19 @@ app.add_middleware(
120
  router = APIRouter(prefix="/fit", tags=["fit"])
121
 
122
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  @router.get("/health")
124
  def health() -> dict:
125
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}
 
120
  router = APIRouter(prefix="/fit", tags=["fit"])
121
 
122
 
123
+ @router.get("/")
124
+ def index() -> FileResponse:
125
+ """Serve the AI Fit page."""
126
+ base = os.path.dirname(__file__)
127
+ return FileResponse(os.path.join(base, "static", "index.html"))
128
+
129
+ # Add route without trailing slash for compatibility
130
+ @router.get("")
131
+ def index_no_slash() -> FileResponse:
132
+ """Serve the AI Fit page (no trailing slash)."""
133
+ base = os.path.dirname(__file__)
134
+ return FileResponse(os.path.join(base, "static", "index.html"))
135
+
136
  @router.get("/health")
137
  def health() -> dict:
138
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}
AIQuiz/app/main.py CHANGED
@@ -196,6 +196,19 @@ app.add_middleware(
196
  router = APIRouter(prefix="/quiz", tags=["quiz"])
197
 
198
 
 
 
 
 
 
 
 
 
 
 
 
 
 
199
  @router.get("/health")
200
  def health() -> dict:
201
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}
 
196
  router = APIRouter(prefix="/quiz", tags=["quiz"])
197
 
198
 
199
+ @router.get("/")
200
+ def index() -> FileResponse:
201
+ """Serve the AI Quiz page."""
202
+ base = os.path.dirname(__file__)
203
+ return FileResponse(os.path.join(base, "static", "index.html"))
204
+
205
+ # Add route without trailing slash for compatibility
206
+ @router.get("")
207
+ def index_no_slash() -> FileResponse:
208
+ """Serve the AI Quiz page (no trailing slash)."""
209
+ base = os.path.dirname(__file__)
210
+ return FileResponse(os.path.join(base, "static", "index.html"))
211
+
212
  @router.get("/health")
213
  def health() -> dict:
214
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}
AIRoute/app/main.py CHANGED
@@ -272,6 +272,19 @@ app.add_middleware(
272
  router = APIRouter(prefix="/route", tags=["route"])
273
 
274
 
 
 
 
 
 
 
 
 
 
 
 
 
 
275
  @router.get("/health")
276
  def health() -> dict:
277
  return {
 
272
  router = APIRouter(prefix="/route", tags=["route"])
273
 
274
 
275
+ @router.get("/")
276
+ def index() -> FileResponse:
277
+ """Serve the AI Route page."""
278
+ base = os.path.dirname(__file__)
279
+ return FileResponse(os.path.join(base, "static", "index.html"))
280
+
281
+ # Add route without trailing slash for compatibility
282
+ @router.get("")
283
+ def index_no_slash() -> FileResponse:
284
+ """Serve the AI Route page (no trailing slash)."""
285
+ base = os.path.dirname(__file__)
286
+ return FileResponse(os.path.join(base, "static", "index.html"))
287
+
288
  @router.get("/health")
289
  def health() -> dict:
290
  return {
AISaas/app/main.py CHANGED
@@ -161,6 +161,19 @@ app.add_middleware(
161
  router = APIRouter(prefix="/saas", tags=["saas"])
162
 
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  @router.get("/health")
165
  def health() -> dict:
166
  return {
 
161
  router = APIRouter(prefix="/saas", tags=["saas"])
162
 
163
 
164
+ @router.get("/")
165
+ def index() -> FileResponse:
166
+ """Serve the AI Saas page."""
167
+ base = os.path.dirname(__file__)
168
+ return FileResponse(os.path.join(base, "static", "index.html"))
169
+
170
+ # Add route without trailing slash for compatibility
171
+ @router.get("")
172
+ def index_no_slash() -> FileResponse:
173
+ """Serve the AI Saas page (no trailing slash)."""
174
+ base = os.path.dirname(__file__)
175
+ return FileResponse(os.path.join(base, "static", "index.html"))
176
+
177
  @router.get("/health")
178
  def health() -> dict:
179
  return {
AIStrategy/app/main.py CHANGED
@@ -124,6 +124,19 @@ app.add_middleware(
124
  router = APIRouter(prefix="/strategy", tags=["strategy"])
125
 
126
 
 
 
 
 
 
 
 
 
 
 
 
 
 
127
  @router.get("/health")
128
  def health() -> dict:
129
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}
 
124
  router = APIRouter(prefix="/strategy", tags=["strategy"])
125
 
126
 
127
+ @router.get("/")
128
+ def index() -> FileResponse:
129
+ """Serve the AI Strategy page."""
130
+ base = os.path.dirname(__file__)
131
+ return FileResponse(os.path.join(base, "static", "index.html"))
132
+
133
+ # Add route without trailing slash for compatibility
134
+ @router.get("")
135
+ def index_no_slash() -> FileResponse:
136
+ """Serve the AI Strategy page (no trailing slash)."""
137
+ base = os.path.dirname(__file__)
138
+ return FileResponse(os.path.join(base, "static", "index.html"))
139
+
140
  @router.get("/health")
141
  def health() -> dict:
142
  return {"status":"ok","openai_key": bool(os.getenv("OPENAI_API_KEY")), "model": os.getenv("OPENAI_MODEL","gpt-4o-mini")}