Skip to content

Instantly share code, notes, and snippets.

@lauramorillo
Last active July 3, 2016 16:04
Show Gist options
  • Save lauramorillo/47fc123c9af37fbbd220a1f3bfa292d5 to your computer and use it in GitHub Desktop.
Save lauramorillo/47fc123c9af37fbbd220a1f3bfa292d5 to your computer and use it in GitHub Desktop.
First gcloud use for node.js
var gcloud = require('gcloud')({
projectId: 'testing-project',
apiEndpoint: 'http://localhost:8080'
});
function createUser(userData){
return new Promise((resolve, reject) => {
const key = datastore.key(['Users', userData.dni]);
datastore.save({ key: key, data: userData }, err => {
if (!err) {
resolve();
} else {
reject(err);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment