feat: serve httpTts-mimo.json via /httpTts.json for direct app import

This commit is contained in:
TTS Service
2026-03-27 14:16:28 +08:00
parent cef7d3b400
commit 01ce05e530
2 changed files with 12 additions and 0 deletions

View File

@@ -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")