47 lines
1.2 KiB
Python
47 lines
1.2 KiB
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
# Import route modules
|
|
from routes import general, home_assistant, frigate, immich, events
|
|
|
|
# Create FastAPI app
|
|
app = FastAPI(
|
|
title="LabFusion Service Adapters",
|
|
description="Service integration adapters for Home Assistant, Frigate, Immich, and other homelab services",
|
|
version="1.0.0",
|
|
license_info={
|
|
"name": "MIT License",
|
|
"url": "https://opensource.org/licenses/MIT"
|
|
},
|
|
servers=[
|
|
{
|
|
"url": "http://localhost:8000",
|
|
"description": "Development Server"
|
|
},
|
|
{
|
|
"url": "https://adapters.labfusion.dev",
|
|
"description": "Production Server"
|
|
}
|
|
]
|
|
)
|
|
|
|
# CORS middleware
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["*"],
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# Include routers
|
|
app.include_router(general.router)
|
|
app.include_router(home_assistant.router)
|
|
app.include_router(frigate.router)
|
|
app.include_router(immich.router)
|
|
app.include_router(events.router)
|
|
|
|
if __name__ == "__main__":
|
|
import uvicorn
|
|
uvicorn.run(app, host="0.0.0.0", port=8000)
|