forked from nullvoid-ky/oop_project_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
37 lines (34 loc) · 725 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from routers import auth, chat, chat_room, controller, mate
from internal.controller import Controller
app = FastAPI(openapi_prefix="/api")
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"]
)
app.include_router(
auth.router,
tags=["auth"]
)
app.include_router(
chat.router,
tags=["chat"]
)
app.include_router(
controller.router,
tags=["controller"]
)
app.include_router(
mate.router,
tags=["mate"]
)
app.include_router(
chat_room.router,
tags=["chat-room"]
)
controller = Controller()
controller.add_instance()