diff --git a/Dockerfile b/Dockerfile index b8c8f00..ecef2ae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,7 @@ COPY requirements.txt . RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt COPY app/ . +COPY httpTts-mimo.json . RUN mkdir -p /app/data /app/audio diff --git a/app/main.py b/app/main.py index ed50bd1..59f8acb 100644 --- a/app/main.py +++ b/app/main.py @@ -492,6 +492,17 @@ async def get_config(): } +# ── 配置文件下载 ─────────────────────────────────────────────────────────── + +@app.get("/httpTts.json") +async def serve_http_tts_config(): + """提供 App 导入用的音频源配置文件""" + config_path = os.path.join(config.BASE_DIR, "httpTts-mimo.json") + if os.path.exists(config_path): + return FileResponse(config_path, media_type="application/json") + raise HTTPException(404, "配置文件不存在") + + # ── 静态文件 & 前端 ────────────────────────────────────────────────────── app.mount("/audio", StaticFiles(directory=config.AUDIO_DIR), name="audio")