Skip to content

Instantly share code, notes, and snippets.

@lgvalle
Last active August 8, 2017 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgvalle/171af29ac7c8601e8a6adc52a00b9197 to your computer and use it in GitHub Desktop.
Save lgvalle/171af29ac7c8601e8a6adc52a00b9197 to your computer and use it in GitHub Desktop.
Post: Take control of your backend (II)
const Client = require('node - rest - client').Client
const client = new Client()
exports.fetch = functions.https.onRequest((req, res) => {
client.get(BACKEND_URL, function (data, response) {
() // TODO Clean up
return res.status(200)
.type('application / json')
.send(data)
})
 }) 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment