feat: routes
This commit is contained in:
+8
-3
@@ -3,11 +3,12 @@
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi import FastAPI, WebSocket
|
||||
|
||||
from app.api.errors import register_exception_handlers
|
||||
from app.api.health import router as health_router
|
||||
from app.api.middleware import CorrelationIdMiddleware
|
||||
from app.api.rest import subsonic_router
|
||||
from app.api.v1 import api_v1_router
|
||||
from app.core.config import get_settings
|
||||
from app.core.logging import configure_logging, get_logger
|
||||
@@ -43,8 +44,12 @@ def create_app() -> FastAPI:
|
||||
|
||||
app.include_router(health_router)
|
||||
app.include_router(api_v1_router)
|
||||
# Subsonic-compatible layer is mounted in a later step:
|
||||
# app.include_router(subsonic_router, prefix="/rest")
|
||||
app.include_router(subsonic_router, prefix="/rest")
|
||||
|
||||
@app.websocket("/ws")
|
||||
async def ws_stub(websocket: WebSocket) -> None:
|
||||
await websocket.accept()
|
||||
await websocket.close(1001)
|
||||
|
||||
return app
|
||||
|
||||
|
||||
Reference in New Issue
Block a user