-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
29 lines (26 loc) · 766 Bytes
/
main.py
File metadata and controls
29 lines (26 loc) · 766 Bytes
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
from fastapi.middleware.cors import CORSMiddleware
from fastapi import FastAPI
from config.database import engine, Base
from middlewares.error_handler import ErrorHandler
from routers.user_router import user_router
from routers.draw_router import draw_router
from routers.ws_figures_router import ws_figures_router
app = FastAPI()
app.title = "Api-PAINT"
app.version = "0.0.1"
origins = [
"http://localhost",
"http://localhost:4200",
]
app.add_middleware(ErrorHandler)
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(user_router)
app.include_router(draw_router)
app.include_router(ws_figures_router)
Base.metadata.create_all(bind=engine)