mirror of https://github.com/Budibase/budibase.git
5 changed files with 20 additions and 12 deletions
@ -1,12 +1,9 @@ |
|||
const PouchDB = require("pouchdb") |
|||
const env = require("../environment") |
|||
let Pouch |
|||
|
|||
// level option is purely for testing (development)
|
|||
const COUCH_DB_URL = |
|||
env.COUCH_DB_URL || "http://budibase:budibase@localhost:10000/db/" |
|||
module.exports.getDB = () => { |
|||
return Pouch |
|||
} |
|||
|
|||
const Pouch = PouchDB.defaults({ |
|||
prefix: COUCH_DB_URL, |
|||
}) |
|||
|
|||
module.exports = Pouch |
|||
module.exports.setDB = pouch => { |
|||
Pouch = pouch |
|||
} |
|||
|
|||
Loading…
Reference in new issue