Skip to content

Instantly share code, notes, and snippets.

@mmetting
Created June 21, 2017 15:32
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/9a169ec5b911a24e47d455655812cf50 to your computer and use it in GitHub Desktop.
Save mmetting/9a169ec5b911a24e47d455655812cf50 to your computer and use it in GitHub Desktop.
Change /hello endpoint to use $fh.db to store string in MongoDB
var $fh = require('fh-mbaas-api');
var options = {
"act": "create",
"type": "myFirstEntity",
"fields": {
"name": world
}
};
$fh.db(options, function (err, data) {
if (err) {
console.error("Error " + err);
} else {
console.log(JSON.stringify(data));
}
});
res.json({ msg: 'Hello ' + world });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment