How I can make a http request with firebase to external APIs?

2,627 views
Skip to first unread message

David Hinojosa Muñoz

unread,
May 22, 2016, 11:51:03 AM5/22/16
to Firebase Google Group

I would like to migrate an app Node.js to FireBase. In NodeJS Server was using this:

var express = require('express');
var app = express();
app.get('/rq/bots', function (req, res) {
var query='http://externalAPIQuery?q=something'
var request = require('request');
request(query, function (error, response, body) {
      if (!error && response.statusCode == 200) {
        res.json(JSON.parse(body))
      }
    })
})

and from client used to use jQuery to call the functions of the server:

var parameters = { 'terms' 'term'}
$ .get ( '/ Rq / bots', parameters, function (data) {
         console.log (data);})

But FireBase has no management server and do not know how I make external http request. Someone can help me make an external request with firebase. Thank you very much in advance.

Frank van Puffelen

unread,
May 22, 2016, 12:08:29 PM5/22/16
to Firebase Google Group
Reply all
Reply to author
Forward
0 new messages