【发布时间】:2018-04-07 09:40:36
【问题描述】:
当我尝试部署功能时,它会出现一些问题。下面是我的代码
const functions = require('firebase-functions');
const admin = require('firebase-admin');
admin.initializeApp();
exports.addNewMessage = functions.https.onRequest((req, res) => {
// Grab the text parameter.
const original = req.query.text;
// Push the new message into the Realtime Database using the Firebase Admin SDK.
return admin.database().ref('/messages').push({original: original}).then((snapshot) => {
// Redirect with 303 SEE OTHER to the URL of the pushed object in the Firebase console.
return res.redirect(303, snapshot.ref.toString());
});
});
当我尝试部署时遇到问题,请在此处输入链接描述
我不明白到底是什么问题。对于 firebase-admin 模块 是否需要启用或设置环境配置? 如果是,那么如何?我没有找到任何文件我没有任何人请帮助我
【问题讨论】:
标签: node.js firebase google-cloud-firestore google-cloud-functions