Last active
July 3, 2016 16:04
-
-
Save lauramorillo/47fc123c9af37fbbd220a1f3bfa292d5 to your computer and use it in GitHub Desktop.
First gcloud use for node.js
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 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