我有一个主要的firebase云功能,主要功能.但我需要创建另一个更具体的,使用主云功能的功能.我是否可以通过免费帐户请求http Post或从一个firebase云功能获取到另一个firebase云功能?
我试图制作它,但我得到了'ENOTFOUND'消息,我想知道我的代码是否有问题,或者它只是免费帐户的限制.
index.js'use strict';
const functions = require('firebase-functions');
const express = require('express');
const app = express();
app.post('/test', function(req, res) {
var request = require('request')
var options = {
method: 'post',
body: req.body, // re-send the incoming body to the main cloud function
json: true,
url: '<main cloud url>',
headers: req.headers // re-send the incoming headers the main cloud function
}
request(options, function (err, response, body) {
if (err || response.statusCode != 200) {
res.status(400).send(err); //re-send the received error …Run Code Online (Sandbox Code Playgroud)