pouchdb: Can't set default prefix for the http adapter
I’ve tried setting up a few pouch “defaults” in my node app according to this method described in the docs:
exports.remote = PouchDB.defaults({
adapter: 'http',
prefix: exports.prefix
});
exports.admin = PouchDB.defaults({
adapter: 'http',
prefix: exports.prefix,
auth: exports.adminAuth
});
But it seems like it ignores the prefix entirely. First it didn’t automatically use the http adapter (which is why I added it). Then it still just tries to connect to “pouch{name}”.
Looking at lib/setup.js
it seems like the prefix is a global variable set on the PouchDB constructor, and not an option which can be overridden, or am I reading it wrong?
Besides this, thanks for a wonderful library!
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 15 (15 by maintainers)
Commits related to this issue
- [#3923] Use opts.prefix if it exists This is a quick workaround for prefix defaults not being respected when using the http adapter. — committed to slaskis/pouchdb by slaskis 9 years ago
- (#3923) - Add ability to set url as prefix — committed to pouchdb/pouchdb by daleharvey 8 years ago
- (#3923) - Add ability to set url as prefix — committed to pouchdb/pouchdb by daleharvey 8 years ago
- (#3923) - Add ability to set url as prefix — committed to pouchdb/pouchdb by daleharvey 8 years ago
- (#3923) - Add ability to set url as prefix — committed to pouchdb/pouchdb by daleharvey 8 years ago
Added in https://github.com/pouchdb/pouchdb/commit/2b30ee1ab46f8268730976e3cb790df4e9659123
I am gonna work on this