我正在尝试将邮递员的请求发送到我的Firebase,但是在部署我的代码后,我在说:错误:无法处理请求
我检查了100次代码。
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.getheads = functions.https.onRequest((req, res )=> {
admin
.firestore()
.collection('heads')
.get()
.then((data) => {
let heads =[];
data.forEach((doc) => {
heads.push(doc.data());
});
return res.json(heads);
})
.catch((err) => console.error(err));
});
发送带有url的请求后,我希望邮递员将我在Firebase中创建的文档带给我。