Not*_*bad 3 node.js firebase google-cloud-functions firebase-cli
我知道 firebase https.onRequest 中的请求参数对应于 Express 响应。
我想使用这种格式运行云函数(本地测试):
http://localhost:5000/test-2c6e8/us-central1/coins?userid=1
Run Code Online (Sandbox Code Playgroud)
所以,现在我只想从云函数获取 userId 参数。我写的测试函数是:
exports.coins = functions.https.onRequest((request, response) =>
{
var db = admin.firestore();
response.json({query: JSON.stringify(request.query),
params: JSON.stringify(request.params),
body: JSON.stringify(request.body)});
response.end();
});
Run Code Online (Sandbox Code Playgroud)
这是我得到的输出:
query "{}"
params "{\"0\":\"\"}"
body "{}"
Run Code Online (Sandbox Code Playgroud)
我尝试了很多事情但没有任何运气。为什么会发生这种情况?
| 归档时间: |
|
| 查看次数: |
4039 次 |
| 最近记录: |