Firebase - 单击按钮时 运行 "functions.https" 在云函数中
Firebase - run "functions.https" in a cloud function when button clicked
是否可以通过单击 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
是否可以通过单击 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