Skip to content

Instantly share code, notes, and snippets.

@mmetting
Last active June 21, 2017 15:42
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 mmetting/29dfce75eccca08b083d5046d5885515 to your computer and use it in GitHub Desktop.
Save mmetting/29dfce75eccca08b083d5046d5885515 to your computer and use it in GitHub Desktop.
Return DB response from service to cloud, and then from cloud to client (Cloud App)
var $fh = require('fh-mbaas-api');
$fh.service({
"guid": "jfi5oop5vbxmvfcfkef4qyyz",
"path": "/hello",
"method": "GET",
"params": {
"hello": world
},
"timeout": 25000
}, function (err, body, response) {
console.log('statuscode: ', response && response.statusCode);
if (err) {
// An error occurred during the call to the service. log some debugging information
console.log('service call failed - err : ', err);
res.status(500).json({ msg: err });
} else {
console.log('Got response from service - status body : ', res.statusCode, body);
res.status(200).json({ msg: body });
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment