Files
sitemente/app/api/tts-proxy/route.ts
T
horus 45af56d9cf feat(mission-control): restore MC tabs - temple, office, memory, claude, pdf-viewer, resume, resume-upload, temple-3d, demos
Also added:
- Memory API endpoints
- Briefs API endpoints
- AnveVoice stats API
- Claude spawn API
- TTS proxy
- Cleopatra voice widget
- api-auth middleware
2026-03-23 16:30:44 +01:00

32 lines
835 B
TypeScript

import { NextResponse } from 'next/server';
const TTS_API = "http://185.45.195.201:5001/api/tts/base64";
export async function POST(request: Request) {
try {
const { text, lang = "es" } = await request.json();
if (!text) {
return NextResponse.json({ error: "No text provided" }, { status: 400 });
}
// Call Cleopatra's TTS API (HTTP)
const response = await fetch(TTS_API, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ text, lang })
});
if (!response.ok) {
throw new Error("TTS API error");
}
const data = await response.json();
return NextResponse.json(data);
} catch (error) {
console.error("TTS proxy error:", error);
return NextResponse.json({ error: "TTS failed" }, { status: 500 });
}
}