FEAT: Integrated Document Engine with WebP optimization, Thumbnail generation and Hybrid (NAS/SSD) storage logic
This commit is contained in:
@@ -1,30 +1,45 @@
|
||||
import os
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from app.api.v1.api import api_router
|
||||
from app.core.config import settings
|
||||
|
||||
# 1. Könyvtárstruktúra biztosítása (SSD puffer a miniképeknek)
|
||||
# Ez garantálja, hogy az app elindulásakor létezik a célmappa
|
||||
os.makedirs("static/previews", exist_ok=True)
|
||||
|
||||
app = FastAPI(
|
||||
title="Service Finder API",
|
||||
version="2.0.0", # A rendszer verziója, de a végpont marad v1
|
||||
version="2.0.0",
|
||||
openapi_url="/api/v1/openapi.json",
|
||||
docs_url="/docs"
|
||||
)
|
||||
|
||||
# PONTOS CORS BEÁLLÍTÁS
|
||||
# 2. PONTOS CORS BEÁLLÍTÁS
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=[
|
||||
"http://192.168.100.10:3001", # Frontend portja
|
||||
"http://localhost:3001",
|
||||
"https://dev.profibot.hu" # Ha van NPM proxy
|
||||
"https://dev.profibot.hu" # NPM proxy esetén
|
||||
],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# 3. STATIKUS FÁJLOK KISZOLGÁLÁSA
|
||||
# Ez teszi lehetővé, hogy a /static eléréssel lekérhetőek legyenek a miniképek
|
||||
app.mount("/static", StaticFiles(directory="static"), name="static")
|
||||
|
||||
# 4. ROUTER BEKÖTÉSE
|
||||
app.include_router(api_router, prefix="/api/v1")
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"status": "online", "message": "Service Finder Master System v1.0"}
|
||||
return {
|
||||
"status": "online",
|
||||
"message": "Service Finder Master System v2.0",
|
||||
"features": ["Document Engine", "Asset Vault", "Org Onboarding"]
|
||||
}
|
||||
Reference in New Issue
Block a user