42 lines
1003 B
Python
42 lines
1003 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core import settings
|
|
from app.api import search, downloads, history, config, files, artist, album, playlist, discover, podcast
|
|
|
|
app = FastAPI(title="streamrip-ui")
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=["http://localhost:3000", "http://127.0.0.1:3000"],
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
@app.get("/api/health")
|
|
def health():
|
|
return {"status": "ok"}
|
|
|
|
|
|
@app.get("/api/version")
|
|
def version():
|
|
return {"version": settings.APP_VERSION}
|
|
|
|
|
|
@app.get("/api/sources")
|
|
def sources():
|
|
return {"sources": settings.SOURCES}
|
|
|
|
|
|
app.include_router(search.router)
|
|
app.include_router(downloads.router)
|
|
app.include_router(history.router)
|
|
app.include_router(config.router)
|
|
app.include_router(files.router)
|
|
app.include_router(artist.router)
|
|
app.include_router(album.router)
|
|
app.include_router(playlist.router)
|
|
app.include_router(discover.router)
|
|
app.include_router(podcast.router)
|