I'm trying to access the text-to-speech service provided by IBM Watson in my NodeJs application but I see access denial error as the service has been blocked by CORS policy. Tried all the ways by setting up related headers in app.js but fail to resolve the issue.
https://cloud.ibm.com/apidocs/text-to-speech?code=node
app.use(function(req, res, next) {
res.header("Access-Control-Allow-Origin", "http://localhost:3000");
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
next();
});
Whenever I send any text from my NodeJS application a speech should be heard saying the relative response.