I was trying to make a request to the api using nodejs express but it does not return anything and it times out
my code:
mport express from 'express';
import axios from 'axios';
import { TextEncoder } from 'util';
import fs from 'fs';
import path from 'path';
const ENDPOINT = 'https://tiktok-tts.weilnet.workers.dev';
const text = 'hello baby';
const voice = "en_us_ghostface"
axios({
method: 'post',
url: `${ENDPOINT}/api/generation`,
headers: {
'Content-Type': 'application/json',
},
data: {
text: text,
voice: voice,
},
})
.then((response) => {
// Handle successful response
response.data.pipe(fs.createWriteStream('audio.mp3'));
})
.catch((error) => {
// Handle error
console.error(error);
});