eyuvaraj commited on
Commit
0986a79
·
verified ·
1 Parent(s): 9cbdeca

Update routes/index.js

Browse files
Files changed (1) hide show
  1. routes/index.js +12 -3
routes/index.js CHANGED
@@ -3,7 +3,7 @@ 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 => {
@@ -13,12 +13,21 @@ router.post('/talk', function(req, res, next) {
13
  // res.json({});
14
  // });
15
 
16
- // Return a dummy string as output
17
- res.json({ message: "Dummy response: text-to-speech is temporarily disabled." });
 
 
 
 
 
 
 
 
18
  });
19
 
20
 
21
 
 
22
  /* GET home page. */
23
  router.get('/', function(req, res, next) {
24
  res.render('index', { title: 'Express' });
 
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 => {
 
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
 
28
 
29
 
30
+
31
  /* GET home page. */
32
  router.get('/', function(req, res, next) {
33
  res.render('index', { title: 'Express' });