firebase - 无法部署firebase功能
问题描述
当我尝试部署 firebase 功能时,终端显示“无法加载,因为在此系统上禁用了运行脚本。”这是我尝试部署的代码。
const functions = require("firebase-functions");
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.helloWorld = functions.https.onRequest((request, response) => {
functions.logger.info("Hello logs!", {structuredData: true});
response.send("Hello world kasun");
});
exports.getScreams=functions.https.onRequest((req, res) => {
admin.firestore().collection('screams').get()
.then(data=> {
let screams =[];
data.forEach(doc => {
screams.push(doc.data());
});
return res.json(screams);
})
.catch((err) => console.error(err));
});
解决方案
推荐阅读
- spring - 在 Kubernetes 中将 spring boot 连接到 postgres statefulset
- android - 在 Kotlin 房间中插入多对多关系
- python - 如何将多个numpy数组组合成一个数据框?
- php - 下载按钮与 Laravel 中的过滤按钮功能相同
- http - REST:处理部分受限资源的正确方法
- image - 在颤动中选择一个时如何向前移动选择图像按钮
- python - 我的熊猫数据框的特定转置
- python - ProcessPoolExecutor如何统计繁忙和空闲进程?
- python - 如何在python中获取解释器命令历史记录
- mysql - PHP SQL按多行排序