Created
April 22, 2014 21:05
-
-
Save cdaringe/11194274 to your computer and use it in GitHub Desktop.
PouchDB relative dir fail
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
// PouchDB relative dir failure gist | |
// in some dir containing this .js file, mkdir db | |
// Run 'node THIS-GIST.js' :: success! | |
// change one dir up. run 'node childdir/THIS-GIST.js' :: fail :( | |
var PouchDB = require('pouchdb'); | |
var dbRoot = './db/', | |
dbTest = new PouchDB(dbRoot + 'pouchdbDirTest'), | |
now = (new Date()).getTime().toString(); | |
dbTest.put({time: now}, now) | |
.then(function putS(r){ | |
console.log('Success!'); | |
console.dir(r); | |
}) | |
.catch(function putF(e){ | |
console.log('Fail!', e.stack); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment