I have a basic cloud firebase function with basic functions. But I need to create another feature that uses the functionality of the main function of the cloud. Can I request an HTTP message or Get from one firebase cloud function another firebase cloud function with a free account?
I tried to do this, but I got the message "ENOTFOUND", I want to know something is wrong with my code, or it's just a limitation of a free account.
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,
json: true,
url: '<main cloud url>',
headers: req.headers
}
request(options, function (err, response, body) {
if (err || response.statusCode != 200) {
res.status(400).send(err);
return
}
res.send(body);
});
});
exports.checkAtivation = functions.https.onRequest(app);
source
share