Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

convert the key from base 64

  • Loading branch information...
commit 4b6b0e080cbcc7f91532ae624a05d25d58d39e9f 1 parent a476c78
@zaach zaach authored
Showing with 6 additions and 3 deletions.
  1. +1 −1  bin/api
  2. +3 −1 lib/db/couchbase.js
  3. +2 −1  lib/db/json.js
View
2  bin/api
@@ -17,7 +17,7 @@ function credentialsFunc(id, callback) {
var credentials = {
id: id,
- key: key,
+ key: new Buffer(key, 'base64'),
algorithm: 'hmac-sha-256',
user: id
};
View
4 lib/db/couchbase.js
@@ -9,7 +9,9 @@ var onError = function(e){
module.exports = {
connect: function(options, cb) {
couchbase.connect(options, function(err, bucket) {
- if (err) cb(err);
+ console.log('database connected');
+ if (db) return cb(null);
+ if (err) return cb(err);
db = bucket;
db.on('error', onError);
cb(null);
View
3  lib/db/json.js
@@ -3,7 +3,8 @@ var db;
module.exports = {
connect: function(options, cb) {
setTimeout(function() {
- if (db) return;
+ console.log('database connected');
+ if (db) return cb(null);
db = {};
cb(null);
}, 0);
Please sign in to comment.
Something went wrong with that request. Please try again.