""" DSMS Gateway - REST API für dezentrales Speichersystem Bietet eine vereinfachte API über IPFS für BreakPilot """ import sys import os # Ensure the gateway directory itself is on the path so routers can use flat imports. sys.path.insert(0, os.path.dirname(__file__)) from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from models import DocumentMetadata, StoredDocument, DocumentList # noqa: F401 — re-exported for tests from routers.documents import router as documents_router from routers.node import router as node_router app = FastAPI( title="DSMS Gateway", description="Dezentrales Daten Speicher System Gateway für BreakPilot", version="1.0.0" ) # CORS Configuration app.add_middleware( CORSMiddleware, allow_origins=["http://localhost:8000", "http://backend:8000", "*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) # Router registration app.include_router(node_router) app.include_router(documents_router) if __name__ == "__main__": import uvicorn uvicorn.run(app, host="0.0.0.0", port=8082)