Simple web backend added with upload/status/process/download API
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
"""FastAPI application entry point."""
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
|
||||
from backend.config import settings
|
||||
from backend.api import upload, split, status, download
|
||||
|
||||
app = FastAPI(
|
||||
title="Audio Splitter Web API",
|
||||
description="Web interface for splitting audio files using a tracklist",
|
||||
version="0.1.0",
|
||||
)
|
||||
|
||||
# CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=settings.allow_origins,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Include routers
|
||||
app.include_router(upload.router)
|
||||
app.include_router(split.router)
|
||||
app.include_router(status.router)
|
||||
app.include_router(download.router)
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def root():
|
||||
return {"status": "ok", "service": "Audio Splitter Web API"}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
async def health():
|
||||
return {"status": "healthy"}
|
||||
Reference in New Issue
Block a user