-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.py
30 lines (21 loc) · 780 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
from fastapi import FastAPI
from auth.routes import router as auth
from block_lists.routes import router as block_lists
from sessions.routes import router as sessions
from fastapi.middleware.cors import CORSMiddleware
from mangum import Mangum
app = FastAPI()
# app.add_middleware(
# CORSMiddleware,
# allow_origins=["*"],
# allow_credentials=True,
# allow_methods=["*"],
# allow_headers=["*"],
# )
@app.get("/", status_code=200)
async def welcome():
return {"detail": "Welcome to website Blocker"}
app.include_router(auth, prefix="/auth", tags=["Authentication"])
app.include_router(block_lists, prefix="/blocklists", tags=["Block Lists"])
app.include_router(sessions, prefix="/sessions", tags=["Sessions"])
handler = Mangum(app, lifespan="off")