firebase - 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
推荐阅读
- firebase - 单个照片路径进入多个 HashMap 元素
- java - Regex java用于提取第一个字母字符的正则表达式
- postgresql - PostgreSQL:第一次日期累积分数
- google-apps-script - 从 Google 电子表格访问 Google 脚本中的存储值
- google-nearby - 附近发送的文件打不开
- javascript - 动态创建div时只允许一个根元素出错
- python - eval()的奇怪行为与python循环中的lambda函数
- html - 如何保存浏览器渲染的缩放图像
- git - 在本地存储库是更新的存储库时恢复 .git 文件
- python - 没有输出的重启错误