Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: Before, `options.db` had to be passed to the Api constructor, pre-initialised with `"pouchdb-users"`: ```js var AccountApi = require("@hoodie/account-server-api") var PouchDB = require("pouchdb") PouchDB.plugin(require("pouchdb-users")) var db = new PouchDB("http://localhost:5984/_users") db.installUsersBehavior().then(function () { var api = new AccountApi({ db: db, secret: "secret123" }) api.accounts.findAll().then(logAccountStats) api.accounts.on("change", logAccountChange) }) ``` Now, `options.PouchDB` is enough. Optionally `options.usersDb` for a custom users db name can be passed (it defaults to `_users`): ```js var AccountApi = require("@hoodie/account-server-api") var PouchDB = require("pouchdb") .plugin(require("pouchdb-users")) var api = new AccountApi({ PouchDB: PouchDB, usersDb: "my-users-db", secret: "secret123" }) ```
- Loading branch information