Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(config) {
var gcloud = require('google-cloud');
var datastore = gcloud.datastore({
projectId: config.projectId,
keyFilename: config.keyFilename
});
var storage = gcloud.storage({
projectId: config.projectId,
keyFilename: config.keyFilename
});
var bucket = storage.bucket(config.bucketName);
function getAllBooks(callback) {
var query = datastore.createQuery(['Book']);
datastore.runQuery(query, callback);
}
function getUserBooks(userId, callback) {
var query = datastore.createQuery(['Book']).filter('userId', '=', userId);
datastore.runQuery(query, callback);
}
module.exports = function(config) {
var gcloud = require('google-cloud');
var datastore = gcloud.datastore({
projectId: config.projectId,
keyFilename: config.keyFilename
});
var storage = gcloud.storage({
projectId: config.projectId,
keyFilename: config.keyFilename
});
var bucket = storage.bucket(config.bucketName);
function getAllBooks(callback) {
var query = datastore.createQuery(['Book']);
datastore.runQuery(query, callback);
}
function getUserBooks(userId, callback) {
callback(new Error('books.getUserBooks [Not Yet Implemented]'));
}
function addBook(title, author, coverImageData, userId, callback) {