19 lines
487 B
Python
19 lines
487 B
Python
# main.py (new project entrypoint)
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from api.v1 import chat, sessions, models # import the routersS
|
|
|
|
app = FastAPI()
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# Mount the router under /v1
|
|
app.include_router(chat.router, prefix="/v1")
|
|
app.include_router(sessions.router, prefix="/v1")
|
|
app.include_router(models.router, prefix="/v1")
|