Firebase - 单击按钮时在云函数中运行"functions.https"



是否可以通过单击HTML中的按钮来运行firebase云函数?

html

<html>
<head>
<title>My Title</title>
</head>
<body>
This is some content
<button onclick="exports.testName('testTxt')">click test</button>
</body>
</html>

index.js

const functions = require('firebase-functions');
exports.testName = functions.https.onRequest((req, res) => {
res.status(200).send(`New Content`);
});

是的,它的调用可调用函数如下所示:https://firebase.google.com/docs/functions/callable

相关内容

  • 没有找到相关文章

最新更新