feat: serve httpTts-mimo.json via /httpTts.json for direct app import
This commit is contained in:
11
app/main.py
11
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")
|
||||
|
||||
Reference in New Issue
Block a user