【发布时间】:2017-12-17 16:43:32
【问题描述】:
我想使用 HTTP 触发器创建一个 Google Cloud 函数,该函数调用另一个函数(例如:changeString)。我知道我可以在 index.js 中包含函数 changeString。但是,我想重用 changeString 以便其他 Google Cloud Functions 可以调用它。
exports.helloWorld = function helloWorld(req, res) {
var result = changeString(req.body.string);
res.send(result);
};
我知道有一个similar question,但它并没有解决我的问题。
【问题讨论】:
-
基本上,我只是想知道从 Google Cloud Function 中的另一个函数调用函数的语法。
标签: node.js function google-cloud-platform google-cloud-functions