-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
33 lines (27 loc) · 791 Bytes
/
main.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
from fastapi import FastAPI, Depends
from fastapi.middleware.cors import CORSMiddleware
from fastapi.security import OAuth2PasswordBearer
from typing import Annotated
from routers import users, settings, analyses
from routers import users, checkin, report
app = FastAPI()
oauth2_scheme = OAuth2PasswordBearer(tokenUrl="token")
origins = [
"http://localhost",
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(users.router)
app.include_router(settings.router)
app.include_router(checkin.router)
app.include_router(analyses.router)
app.include_router(report.router)
@app.get("/")
async def root():
return {"message": "Hello World"}