-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
34 lines (28 loc) · 875 Bytes
/
main.py
File metadata and controls
34 lines (28 loc) · 875 Bytes
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
from fastapi import FastAPI
from api.routers import auth_router, document_router, template_router
from core.database import engine
import models.user_model as user_model
from fastapi.middleware.cors import CORSMiddleware
user_model.Base.metadata.create_all(bind=engine)
app = FastAPI(
title="Vera AI - Refactored API",
description="A clean API structure with separated concerns.",
version="2.0.0",
)
origins = [
"http://localhost:5173",
"https://web-client-alpha.vercel.app"
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(auth_router.router)
app.include_router(document_router.router)
app.include_router(template_router.router)
@app.get("/", tags=["Default"])
def root():
return {"message": "Welcome to the Vera AI API!"}