Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const express = require('express');
const app = express();
const TextToSpeechV1 = require('ibm-watson/text-to-speech/v1.js');
const { IamAuthenticator } = require('ibm-watson/auth');
const textToSpeech = new TextToSpeechV1({
version: '2018-04-05',
authenticator: new IamAuthenticator({
apikey: process.env.TEXT_TO_SPEECH_IAM_APIKEY || 'type-key-here',
}),
url: process.env.TEXT_TO_SPEECH_URL,
});
// Bootstrap application settings
require('./config/express')(app);
const getFileExtension = (acceptQuery) => {
const accept = acceptQuery || '';
switch (accept) {
case 'audio/ogg;codecs=opus':
case 'audio/ogg;codecs=vorbis':
return 'ogg';