Last active
June 21, 2017 15:42
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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