【发布时间】:2019-09-10 04:17:26
【问题描述】:
你好,我是 alexa 技能开发的新手。当我将我的服务器 url 添加到 alexa 端点时,它在 4000 端口上侦听并测试它。它无法与端点通信。尽管如此,当我通过 url 向浏览器发出获取请求时,它完美地向我发送响应。
我已尝试将此网址添加到端点。 https://myprojecturl:4000
app.get('/', function (req, res) {
console.log(uuid);
res.status(200).send('Done during the request');
});
app.post('/', function (req, res) {
console.log("in post")
if (!skill) {
skill = Alexa.SkillBuilders.custom()
.addRequestHandlers(handlers[0], handlers[1], handlers[2], handlers[3], handlers[4], handlers[5], handlers[6], handlers[7], handlers[8], handlers[9], handlers[10], handlers[11], handlers[12])
.create();
}
这是我的 server.js 文件中的 get 和 post 方法,它使用 express.post 方法调用所有由 index.js 文件导出的处理程序
ps:使用 localhost 和 ngrok 一切都运行良好。但是使用服务器 url 产生问题
帮助我与 alexa 技能和我的服务器 url 建立通信
【问题讨论】:
标签: https alexa alexa-skills-kit alexa-skill