Frontend and backend work together fine, complete workflow is implemented
This commit is contained in:
+7
-1
@@ -1,11 +1,13 @@
|
||||
"""FastAPI application entry point."""
|
||||
|
||||
import asyncio
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from backend.config import settings
|
||||
from backend.api import upload, split, status, download
|
||||
from backend.api.websocket import router as websocket_router
|
||||
from backend.services import progress_publisher # Import the module
|
||||
|
||||
app = FastAPI(
|
||||
title="Audio Splitter Web API",
|
||||
@@ -22,6 +24,10 @@ app.add_middleware(
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Store the main event loop in the progress_publisher module
|
||||
# This avoids a circular import
|
||||
progress_publisher.MAIN_LOOP = asyncio.get_running_loop()
|
||||
|
||||
# Include routers
|
||||
app.include_router(upload.router)
|
||||
app.include_router(split.router)
|
||||
@@ -37,4 +43,4 @@ async def root():
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "healthy"}
|
||||
return {"status": "healthy"}
|
||||
|
||||
Reference in New Issue
Block a user