-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
23 lines (18 loc) · 762 Bytes
/
main.py
File metadata and controls
23 lines (18 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from fastapi import FastAPI, HTTPException
from core.database import engineconn
from core.redis_config import redis_config
from core.exceptions import generic_exception_handler, BaseCustomException, base_custom_exception_handler
from src.user.router import router as user_router
from src.content.router import router as content_router
from src.content.aiml.router import router as aiml_router
app = FastAPI()
engine = engineconn()
session = engine.sessionmaker()
rd = redis_config()
# Exception handler
app.add_exception_handler(HTTPException, generic_exception_handler)
app.add_exception_handler(BaseCustomException, base_custom_exception_handler)
# Router
app.include_router(user_router)
app.include_router(content_router)
app.include_router(aiml_router)