openhands commited on
Commit
9ba6edb
·
1 Parent(s): 14690be

Remove conflicting server-side redirect

Browse files

The JavaScript redirect_script already handles / -> /home redirection.
The server-side redirect was causing issues with the proxy.

Files changed (1) hide show
  1. app.py +1 -6
app.py CHANGED
@@ -380,18 +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
- # Add redirect from / to /home (Gradio's multi-page apps need explicit routes)
391
- @root_app.get("/", include_in_schema=False)
392
- async def root_redirect():
393
- return RedirectResponse(url="/home")
394
-
395
  app = gr.mount_gradio_app(root_app, demo, path="/")
396
  logger.info("REST API mounted at /api, Gradio app mounted at /")
397
 
 
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 - the JavaScript redirect_script handles / -> /home
 
 
 
 
390
  app = gr.mount_gradio_app(root_app, demo, path="/")
391
  logger.info("REST API mounted at /api, Gradio app mounted at /")
392