Example #1
0
router.post('/api/alexa',function(req,res) {
    console.log(JSON.stringify(req.body));
    alexa.request(req.body)        // connect express to alexa-app
        .then(function(response) { // alexa-app returns a promise with the response
            res.json(response);      // stream it to express' output
        });
});
Example #2
0
alexa.process = function(req, res, next) {

  app.request(req.body)        // connect express to alexa-app 
    .then(function(response) { // alexa-app returns a promise with the response 
      res.send(response);      // stream it to express' output 
  });
    
  next();
};
Example #3
0
  getNext({ service, lat, lng, limit: 3 }).then(times => {
    const next = times[0];
    const alexa = new Alexa.app('nextbus');
    alexa.launch((req, res) => {
      res.say(`The next bus is due in ${next.due} minutes`);
    });

    alexa.intent('NextBusIntent', {}, (req, res) => {
      res.say(`The next bus is due in ${next.due} minutes`);
    });

    return alexa.request(req.body).then(answer => res.json(answer));
  }).catch(e => {
Example #4
0
app.post('/echo/sample', ({ body }, res) => {
  alexaApp
    .request(body)
    .then((response) => res.json(response))
})