-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.py
47 lines (30 loc) · 868 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
from sqlalchemy.orm import Session
from fastapi import FastAPI, Depends
from fastapi.middleware.cors import CORSMiddleware
from database.db import get_db
#for testing
from sqlalchemy import func
#===========================
from user import app as user
from user_login import app as user_login
from llama import app as llama
from whatsapp import app as whatsapp
app = FastAPI()
origins = [
"http://localhost:3000",
]
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"]
)
app.include_router(user, tags=["User"])
app.include_router(user_login, tags=["User"])
app.include_router(llama, tags=["Llama"])
app.include_router(whatsapp, tags=["WhatsApp"])
#Testing:
@app.get("/")
def read_root(db: Session = Depends(get_db)):
return {"Message": "Debugger page"}