I'm using the Dialogflow node.js webhook component with express. Here's the boilerplate.
import { dialogflow } from 'actions-on-google';
import express from 'express';
import bodyParser from 'body-parser';
// app init, handle intents
const app = dialogflow()
app.intent('Default Welcome Intent', conv => {
conv.ask('Welcome to the awesome reminder action!');
});
app.intent('Some Custom Intent', conv => {
conv.ask('Say something');
});
// bind to express
express().use(bodyParser.json(), app).listen(5000)
Now, I can add a middleware to the dialogflow app (with app.middleware(function)
) that runs before intents are handled. Does anyone know how to add a middleware that runs after intents are handled?