我没有通过使用 actions-on-google 库获得对 heroku 的 webhook post 请求
I'm not getting webhook post request for heroku by using actions-on-google library
您好,我遇到一个问题,如果我使用 actions-on-google 库,我将无法获得对 heroku 的 webhook post 请求。但是当我使用 dialogflow-fulfillment 时,我会通过使用
获取 webhook post 请求
webhookclient({request:req,response:resp})
我必须使用 heroku 没有选项。它是否仅适用于 firebase?
还有一个问题,当我使用 google 迷你设备进行测试时,我无法获取设备的粗略位置,但它在 simulator.Is 中工作正常,它们是否与上述问题相关?
这是我当前的代码
const {dialogflow,Permission,List} = require('actions-on-google');
const {WebhookClient} = require('dialogflow-fulfillment');
const express = require('express');
const server = express();
server.post('/',function(req,res){
const agent = new WebhookClient({ request: req, response: res });
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
agent.handleRequest(intentMap);
});
server.listen((process.env.PORT || 3000), function () {
console.log("Server listening");
});
要将 an Express server 与 Google 上的操作一起使用,请遵循类似于以下的代码段:
const express = require('express')
const bodyParser = require('body-parser')
// ... app code here
const expressApp = express().use(bodyParser.json())
expressApp.post('/fulfillment', app)
expressApp.listen(3000)
您好,我遇到一个问题,如果我使用 actions-on-google 库,我将无法获得对 heroku 的 webhook post 请求。但是当我使用 dialogflow-fulfillment 时,我会通过使用
获取 webhook post 请求webhookclient({request:req,response:resp})
我必须使用 heroku 没有选项。它是否仅适用于 firebase? 还有一个问题,当我使用 google 迷你设备进行测试时,我无法获取设备的粗略位置,但它在 simulator.Is 中工作正常,它们是否与上述问题相关?
这是我当前的代码
const {dialogflow,Permission,List} = require('actions-on-google');
const {WebhookClient} = require('dialogflow-fulfillment');
const express = require('express');
const server = express();
server.post('/',function(req,res){
const agent = new WebhookClient({ request: req, response: res });
let intentMap = new Map();
intentMap.set('Default Welcome Intent', welcome);
agent.handleRequest(intentMap);
});
server.listen((process.env.PORT || 3000), function () {
console.log("Server listening");
});
要将 an Express server 与 Google 上的操作一起使用,请遵循类似于以下的代码段:
const express = require('express')
const bodyParser = require('body-parser')
// ... app code here
const expressApp = express().use(bodyParser.json())
expressApp.post('/fulfillment', app)
expressApp.listen(3000)