31 lines
821 B
Python
31 lines
821 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
from app.api.router import api_router
|
|
from app.core.config import get_parsed_servers, settings
|
|
|
|
app = FastAPI(
|
|
title="Proxmox Duplicate Visualizer API",
|
|
description="Backend de scan et de détection de doublons pour Proxmox VE",
|
|
version="1.0.0"
|
|
)
|
|
|
|
# Configuration CORS pour le Frontend
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.frontend_origins,
|
|
allow_origin_regex=settings.FRONTEND_ORIGIN_REGEX,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
app.include_router(api_router)
|
|
|
|
@app.get("/")
|
|
async def root():
|
|
return {
|
|
"status": "online",
|
|
"message": "Proxmox Visualizer API is running",
|
|
"configured_servers": len(get_parsed_servers())
|
|
}
|