qqwjq1981 commited on
Commit
1de0783
·
verified ·
1 Parent(s): 4c49cd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -7
app.py CHANGED
@@ -55,7 +55,8 @@ from twilio.rest import Client
55
  import asyncio
56
  import uvicorn
57
  from fastapi import FastAPI, Request, HTTPException
58
- from fastapi.responses import HTMLResponse, JSONResponse
 
59
  import nest_asyncio
60
  from twilio.twiml.messaging_response import MessagingResponse
61
 
@@ -1137,15 +1138,10 @@ app.mount("/gradio", demo, name="gradio")
1137
  # Redirect from the root endpoint to the Gradio app
1138
  @app.get("/", response_class=RedirectResponse)
1139
  async def index():
1140
- return "/gradio"
1141
-
1142
 
1143
  # Run the FastAPI server using uvicorn
1144
  if __name__ == "__main__":
1145
  uvicorn.run(app, host="0.0.0.0", port=5000, reload=True, log_level="debug")
1146
 
1147
  # In[ ]:
1148
-
1149
-
1150
-
1151
-
 
55
  import asyncio
56
  import uvicorn
57
  from fastapi import FastAPI, Request, HTTPException
58
+ from fastapi.responses import HTMLResponse, JSONResponse, RedirectResponse
59
+
60
  import nest_asyncio
61
  from twilio.twiml.messaging_response import MessagingResponse
62
 
 
1138
  # Redirect from the root endpoint to the Gradio app
1139
  @app.get("/", response_class=RedirectResponse)
1140
  async def index():
1141
+ return RedirectResponse(url="/gradio", status_code=307)
 
1142
 
1143
  # Run the FastAPI server using uvicorn
1144
  if __name__ == "__main__":
1145
  uvicorn.run(app, host="0.0.0.0", port=5000, reload=True, log_level="debug")
1146
 
1147
  # In[ ]: