33 lines
814 B
Python
33 lines
814 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core.config import settings
|
|
from app.modules.health.router import router as health_router
|
|
from app.modules.projects.router import router as projects_router
|
|
|
|
app = FastAPI(
|
|
title="Aidoit API",
|
|
version="0.1.0",
|
|
description="Shared REST API for the Aidoit personal AI operating system.",
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=[settings.web_origin, settings.msp_origin],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(health_router)
|
|
app.include_router(projects_router, prefix="/api/v1")
|
|
|
|
|
|
@app.get("/")
|
|
async def root() -> dict[str, str]:
|
|
return {
|
|
"name": "Aidoit API",
|
|
"version": "0.1.0",
|
|
"docs": "/docs",
|
|
}
|