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

Most upvoted comments