首页 > 解决方案 > 无法部署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));

});

标签: firebasedeployment

解决方案


推荐阅读