Ypeng12 commited on
Commit
ce20060
·
1 Parent(s): ed65559

restore: set root route to original pure InferRoute Multi-LLM Gateway dashboard

Browse files
Files changed (1) hide show
  1. inferroute/main.py +12 -6
inferroute/main.py CHANGED
@@ -154,12 +154,18 @@ if active_assets_dir:
154
  pass
155
 
156
  @app.get("/", response_class=HTMLResponse)
157
- async def get_index_page():
158
- root_index = os.path.join(project_root_dir, "index.html")
159
- if os.path.exists(root_index):
160
- with open(root_index, "r", encoding="utf-8") as f:
 
 
161
  return f.read()
162
- return await get_quant_page("")
 
 
 
 
163
 
164
  @app.get("/quant", response_class=HTMLResponse)
165
  @app.get("/quant/{full_path:path}", response_class=HTMLResponse)
@@ -174,7 +180,7 @@ async def get_quant_page(full_path: str = ""):
174
  if os.path.exists(html_path):
175
  with open(html_path, "r", encoding="utf-8") as f:
176
  return f.read()
177
- return "<h1>InferRoute & Quant.ai Platform UI Active</h1>"
178
 
179
  @app.get("/quant.html", response_class=HTMLResponse)
180
  async def get_quant_html_page():
 
154
  pass
155
 
156
  @app.get("/", response_class=HTMLResponse)
157
+ @app.get("/platform", response_class=HTMLResponse)
158
+ @app.get("/platform.html", response_class=HTMLResponse)
159
+ async def get_platform_page():
160
+ root_platform = os.path.join(project_root_dir, "platform.html")
161
+ if os.path.exists(root_platform):
162
+ with open(root_platform, "r", encoding="utf-8") as f:
163
  return f.read()
164
+ template_path = os.path.join(os.path.dirname(__file__), "templates", "platform.html")
165
+ if os.path.exists(template_path):
166
+ with open(template_path, "r", encoding="utf-8") as f:
167
+ return f.read()
168
+ return "<h1>InferRoute Multi-LLM API Gateway Platform Active</h1>"
169
 
170
  @app.get("/quant", response_class=HTMLResponse)
171
  @app.get("/quant/{full_path:path}", response_class=HTMLResponse)
 
180
  if os.path.exists(html_path):
181
  with open(html_path, "r", encoding="utf-8") as f:
182
  return f.read()
183
+ return "<h1>Quant.ai Platform UI Active</h1>"
184
 
185
  @app.get("/quant.html", response_class=HTMLResponse)
186
  async def get_quant_html_page():