Build Proxmox visualizer app
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from app.api.router import api_router
|
||||
from app.core.config import 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(settings.parsed_servers)
|
||||
}
|
||||
Reference in New Issue
Block a user