I’ve seen this post and the linked article, Validating signatures however i’m still having trouble with the Alexa signature when deploying on Google Cloud Functions. I’ve install the alexa-verifier-middleware
package.
I feel like I should be doing something with the Express server instead of adding:
exports.handler = async (req, res) => {
await app.handle(new GoogleCloudFunction(req, res));
}
Here’s my index.js
// Use this
const { WebhookVerified: Webhook, ExpressJS, GoogleCloudFunction } = require('jovo-framework');
const {app} = require('./app.js');
// ------------------------------------------------------------------
// HOST CONFIGURATION
// ------------------------------------------------------------------
// ExpressJS (Jovo Webhook)
if (process.argv.indexOf('--webhook') > -1) {
const port = process.env.JOVO_PORT || 3000;
Webhook.jovoApp = app;
Webhook.listen(port, () => {
console.info(`Local server listening on port ${port}.`);
});
Webhook.post(['/webhook','/webhook_alexa'], async (req, res) => {
await app.handle(new ExpressJS(req, res));
});
}
exports.handler = async (req, res) => {
await app.handle(new GoogleCloudFunction(req, res));
};