Skip to content
Snippets Groups Projects
Commit 5cf7e115 authored by Jure's avatar Jure
Browse files

Enable configuration of db's path

parent 76c28b94
No related branches found
No related tags found
No related merge requests found
node_modules/* node_modules/*
db/
npm-debug.log npm-debug.log
.DS_Store .DS_Store
test.log test.log
module.exports = { module.exports = {
secret: 'EXAMPLEDONTUSE', secret: 'EXAMPLEDONTUSE',
dbPath: './db/',
API_ENDPOINT: '/api', API_ENDPOINT: '/api',
routes: 'app/routes.jsx', routes: 'app/routes.jsx',
navigation: 'app/components/Navigation/Navigation.jsx', navigation: 'app/components/Navigation/Navigation.jsx',
......
'use strict' 'use strict'
var PouchDB = require('pouchdb') const config = require('../../config')
const PouchDB = require('pouchdb')
PouchDB.plugin(require('pouchdb-find')) PouchDB.plugin(require('pouchdb-find'))
PouchDB.plugin(require('relational-pouch')) PouchDB.plugin(require('relational-pouch'))
PouchDB.plugin(require('pouchdb-upsert')) PouchDB.plugin(require('pouchdb-upsert'))
global.db = new PouchDB('./db/' + process.env.NODE_ENV) global.db = new PouchDB(config.dbPath + process.env.NODE_ENV)
module.exports = function () { module.exports = function () {
if (!db.rel) { if (!db.rel) {
......
'use strict' 'use strict'
const config = require('../../../config')
const PouchDB = require('pouchdb') const PouchDB = require('pouchdb')
PouchDB.plugin(require('pouchdb-find')) PouchDB.plugin(require('pouchdb-find'))
const dbName = './db/' + process.env.NODE_ENV const dbName = config.dbPath + process.env.NODE_ENV
const logger = require('../../logger') const logger = require('../../logger')
let dbCleaner = () => { let dbCleaner = () => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment