-
Notifications
You must be signed in to change notification settings - Fork 463
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (23 loc) · 741 Bytes
/
main.py
File metadata and controls
31 lines (23 loc) · 741 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
import logging
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.routers import admin, documents, smb
logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(name)s] %(levelname)s: %(message)s")
app = FastAPI(
title="RAG MCP Server - Backend API",
description="Document RAG engine with MCP server for BrownserverN5",
version="1.0.0",
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(documents.router)
app.include_router(smb.router)
app.include_router(admin.router)
@app.get("/health")
async def health():
return {"status": "ok", "service": "rag-backend"}