Commit 02c61f72 authored by anton's avatar anton
Browse files

Use NeDB in memory by default

parent 6708977d
......@@ -35,5 +35,5 @@
}
},
"mongodb": "mongodb://localhost:27017/motionbank_api",
"nedb": "../data"
"nedb": null
}
......@@ -12,7 +12,7 @@ const conditionalDbService = function (app, name) {
}
return MongoService
}
else if (app.get('nedb')) {
else if (typeof app.get('nedb') !== 'undefined') {
const NeDB = require('nedb')
const path = require('path')
const { Service } = require('feathers-nedb')
......@@ -20,7 +20,7 @@ const conditionalDbService = function (app, name) {
constructor (options, app) {
const dbPath = app.get('nedb')
options.Model = new NeDB({
filename: path.join(dbPath, `${name}.db`),
filename: dbPath ? path.join(dbPath, `${name}.db`) : undefined,
autoload: true
})
super(options)
......
Markdown is supported
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