openhands commited on
Commit
c560986
·
1 Parent(s): 20c58ab

Remove redundant root redirect - now handled by proxy

Browse files
Files changed (1) hide show
  1. app.py +1 -7
app.py CHANGED
@@ -380,19 +380,13 @@ logger.info("All routes configured")
380
 
381
  # Mount the REST API on /api
382
  from fastapi import FastAPI
383
- from fastapi.responses import RedirectResponse
384
  from api import api_app
385
 
386
  # Create a parent FastAPI app that will host both the API and Gradio
387
  root_app = FastAPI()
388
  root_app.mount("/api", api_app)
389
 
390
- # Redirect root to /home - use 302 (not 307) for better proxy compatibility
391
- @root_app.get("/", include_in_schema=False)
392
- async def root_redirect():
393
- return RedirectResponse(url="/home", status_code=302)
394
-
395
- # Mount Gradio app at /home and other routes
396
  app = gr.mount_gradio_app(root_app, demo, path="/")
397
  logger.info("REST API mounted at /api, Gradio app mounted at /")
398
 
 
380
 
381
  # Mount the REST API on /api
382
  from fastapi import FastAPI
 
383
  from api import api_app
384
 
385
  # Create a parent FastAPI app that will host both the API and Gradio
386
  root_app = FastAPI()
387
  root_app.mount("/api", api_app)
388
 
389
+ # Mount Gradio app - root redirect is handled by the proxy
 
 
 
 
 
390
  app = gr.mount_gradio_app(root_app, demo, path="/")
391
  logger.info("REST API mounted at /api, Gradio app mounted at /")
392