phuochungus commited on
Commit
febdf5d
1 Parent(s): 23c0b32

Add redirect route to root endpoint

Browse files
Files changed (1) hide show
  1. app/main.py +5 -4
app/main.py CHANGED
@@ -1,4 +1,6 @@
1
  from fastapi import FastAPI
 
 
2
 
3
  from app.graphdb.main import insert2PersonAndSetFriend, deleteFriend
4
  from .routers import image, video, friend_request, me, auth
@@ -12,7 +14,6 @@ app.include_router(me.router)
12
  app.include_router(auth.router)
13
 
14
 
15
- @app.get("/test")
16
- async def test():
17
- await insert2PersonAndSetFriend("1", "2")
18
- await deleteFriend("1", "2")
 
1
  from fastapi import FastAPI
2
+ from starlette.responses import RedirectResponse
3
+
4
 
5
  from app.graphdb.main import insert2PersonAndSetFriend, deleteFriend
6
  from .routers import image, video, friend_request, me, auth
 
14
  app.include_router(auth.router)
15
 
16
 
17
+ @app.get("/")
18
+ def redirect():
19
+ return RedirectResponse(url="/docs")