eyuvaraj commited on
Commit
68967ef
·
verified ·
1 Parent(s): 0986a79

Update routes/index.js

Browse files
Files changed (1) hide show
  1. routes/index.js +7 -19
routes/index.js CHANGED
@@ -3,25 +3,13 @@ var router = express.Router();
3
  var textToSpeech = require('../helpers/tts');
4
 
5
  /* POST /talk */
6
- router.post('/talk', function (req, res, next) {
7
- // Commenting out the function call for now
8
- // textToSpeech(req.body.text, req.body.voice)
9
- // .then(result => {
10
- // res.json(result);
11
- // })
12
- // .catch(err => {
13
- // res.json({});
14
- // });
15
-
16
- // Read AZURE_KEY and AZURE_REGION from environment variables
17
- const azureKey = process.env.AZURE_KEY || 'AZURE_KEY not set';
18
- const azureRegion = process.env.AZURE_REGION || 'AZURE_REGION not set';
19
-
20
- // Return a dummy response with environment variables
21
- res.json({
22
- message: "Dummy response: text-to-speech is temporarily disabled.",
23
- azureKey: azureKey,
24
- azureRegion: azureRegion,
25
  });
26
  });
27
 
 
3
  var textToSpeech = require('../helpers/tts');
4
 
5
  /* POST /talk */
6
+ router.post('/talk', function(req, res, next) {
7
+ textToSpeech(req.body.text, req.body.voice)
8
+ .then(result => {
9
+ res.json(result);
10
+ })
11
+ .catch(err => {
12
+ res.json({});
 
 
 
 
 
 
 
 
 
 
 
 
13
  });
14
  });
15