我一直在遵循this教程,以便部署一个函数,该函数将充当我的API.ai机器人的Webhook,但在我的生命中,我无法部署该函数:
gcloud beta functions deploy helloHttp --stage-bucket [BUCKET_NAME] --trigger-http我确实尝试了不同的变体:
gcloud beta functions deploy weather --stage-bucket staging.weather-abc12.appspot.com --trigger-httphelloHttp:如果我创建了一个名为weather的API.ai项目,它的Google ID是weather-abc12,它应该是哪一个??
--stage-bucket:它应该是什么样子的?当我转到Google Cloud Storage时,我发现了这个: When abc12.apppot.com
然后,我从上面的链接粘贴的index.js文件具有名为helloHttp的函数,所以我将其更改为weather,weather-abc12 (尝试了很多东西...)然后我在终端中得到这个:
(gcloud.beta.functions.deploy) OperationError: code=3, message=Function load error: Node.js module defined by file index.js is expected to export function named weather我的问题类似于另一个发布在here上的问题,不幸的是没有得到任何答案。
发布于 2017-09-06 16:42:02
它现在起作用了!我实际上编辑了错误的index.js文件,这就是为什么即使我更改了函数名,终端也会一直说它不匹配。我的错!
https://stackoverflow.com/questions/46070194
复制相似问题