【发布时间】:2020-02-06 16:45:35
【问题描述】:
我基本上想知道是否可以让 https Google Cloud 函数根据我作为参数传递给它的内容以不同方式执行(就像任何带有参数的普通函数一样)。可能在 URL 中使用简单的查询或任何其他有效的方法。
作为一个例子,看看任何教程中的基本启动函数:
exports.helloWorld = functions.https.onRequest((req, res) => {
res.status(200).send('Hello, World!');
});
我想做这样的事情:
exports.helloWorld = functions.https.onRequest((req, res) => {
let name = req.query;
res.status(200).send(`Hello, ${name}!`);
});
我希望这是有道理的。任何帮助将不胜感激。
【问题讨论】:
标签: javascript node.js google-cloud-platform google-cloud-functions