-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
44 lines (34 loc) · 1.09 KB
/
main.py
File metadata and controls
44 lines (34 loc) · 1.09 KB
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
"""main routes"""
from dotenv import load_dotenv
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
load_dotenv()
# routers
from src.routes.conversations import router as conversations_router
from src.routes.session import router as session_router
from src.routes.interviewer import router as interviewer_router
from src.routes.coach import router as coach_router
app = FastAPI()
origins = [
"http://localhost:3000",
"https://discnet.vercel.app",
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(
conversations_router,
prefix="/conversations",
tags=["Interview Conversations"],
)
app.include_router(session_router, prefix="/sessions", tags=["Sessions"])
app.include_router(interviewer_router, prefix="/interviewer", tags=["Interviewer"])
app.include_router(coach_router, prefix="/coach", tags=["Coach"])
@app.get("/")
def is_awake():
"""dummy endpoint to see if server is at least reachable"""
return {"awake": "live and direct"}