forked from tsai/budibase
3 changed files with 12 additions and 8 deletions
@ -1,14 +1,14 @@ |
|||||
const PouchDB = require("pouchdb") |
const PouchDB = require("pouchdb") |
||||
require("pouchdb-all-dbs")(PouchDB) |
const allDbs = require("pouchdb-all-dbs") |
||||
|
|
||||
module.exports = () => { |
module.exports = () => { |
||||
const COUCH_DB_URL = |
const COUCH_DB_URL = |
||||
process.env.COUCH_DB_URL || "http://admin:password@localhost:5984" |
process.env.COUCH_DB_URL || "http://admin:password@localhost:5984" |
||||
const DATABASE_TYPE = process.env.DATABASE_TYPE || "couch" |
const DATABASE_TYPE = process.env.DATABASE_TYPE || "couch" |
||||
|
|
||||
PouchDB.defaults({ |
const pouch = PouchDB.defaults({ |
||||
prefix: COUCH_DB_URL, |
prefix: COUCH_DB_URL, |
||||
}) |
}) |
||||
|
allDbs(pouch) |
||||
return PouchDB |
return pouch |
||||
} |
} |
||||
|
|||||
Loading…
Reference in new issue