我在用Dialogflow节点.jswebhook组件与express。这是样板。
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)
现在,我可以向dialogflow应用程序添加一个中间件(使用
app.middleware(function)
之前
之后
意图得到处理?