infra/modules/kubernetes/ebook2audiobook/audiblez-web/backend/main.py
Viktor Barzin bcad200a23 chore: add untracked stacks, scripts, and agent configs
- New stacks: beads-server, hermes-agent
- Terragrunt tiers.tf for infra, phpipam, status-page
- Secrets symlinks for vault, phpipam, hermes-agent
- Scripts: cluster_manager, image_pull, containerd pullthrough setup
- Frigate config, audiblez-web app source, n8n workflows dir
- Claude agent: service-upgrade, reference: upgrade-config.json
- Removed: claudeception skill, excalidraw empty submodule, temp listings

[ci skip]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 09:33:06 +00:00

41 lines
1.1 KiB
Python

from fastapi import FastAPI
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from pathlib import Path
from api.routes import router
from api.websocket import websocket_endpoint
app = FastAPI(title="Audiblez Web API", version="1.0.0")
# CORS middleware for development
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
# Health check - must be before static mount
@app.get("/health")
async def health_check():
return {"status": "healthy"}
# Include API routes
app.include_router(router)
# WebSocket endpoint
@app.websocket("/ws/jobs/{job_id}")
async def websocket_route(websocket, job_id: str):
await websocket_endpoint(websocket, job_id)
# Serve static frontend files - MUST BE LAST as it catches all routes
static_dir = Path("/app/frontend/dist")
if static_dir.exists():
app.mount("/", StaticFiles(directory=str(static_dir), html=True), name="static")
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)