budibase/packages/server/db/client.js

15 lines
325 B
JavaScript
Raw Normal View History

const PouchDB = require("pouchdb")
2020-04-24 18:28:32 +02:00
require("pouchdb-all-dbs")(PouchDB)
2020-04-07 16:12:08 +02:00
2020-04-24 18:28:32 +02:00
module.exports = () => {
const COUCH_DB_URL =
process.env.COUCH_DB_URL || "http://admin:password@localhost:5984"
const DATABASE_TYPE = process.env.DATABASE_TYPE || "couch"
2020-04-07 16:12:08 +02:00
2020-04-24 18:28:32 +02:00
PouchDB.defaults({
prefix: COUCH_DB_URL,
})
2020-04-24 18:28:32 +02:00
return PouchDB
}