小编Luc*_*aza的帖子

当我的代码中没有语法错误时,为什么会出现 UserCodeSyntaxError?

我目前正在 nodejs 中创建一个 Dialogflow 聊天机器人,在部署我的代码时,我收到一条错误消息。我试图取消对大多数事情的注释,只留下基本功能代码,但我仍然无法让它工作。我不完全确定这里的问题是什么

'use strict';
  import {getAPIresponse} from "./api/index.js";

// const http = require('https');

// const respond = fulfillmentText => {
//   return {
//     statusCode: 200,
//     body: JSON.stringify({
//       fulfillmentText
//     }),
//     headers: {
//       "Content-Type": "application/json"
//     }
//   }
//
// };

module.exports.dining = async (event,context) => {


    const incoming= JSON.parse(event.body).queryResult;

    console.log(`INCOMING: ${incoming.parameters.hall}`);

    const {
      displayName
    } = incoming.intent;

    console.log(displayName);


    //const menu = getAPIresponse('https://esb.prod.uds.harvard.edu/api/dining/2.0/','events?locationId=36');
    //console.log(menu);
    // if(displayName === 'dining'){
    //   if(incoming.parameters.meal === 'breakfast'){ …
Run Code Online (Sandbox Code Playgroud)

node.js aws-lambda serverless

15
推荐指数
3
解决办法
2万
查看次数

标签 统计

aws-lambda ×1

node.js ×1

serverless ×1