Use knex instead of js-data

This commit is contained in:
Zalmoxisus
2016-11-08 22:48:32 +02:00
parent 7c106cd843
commit fd9f7f2c0d
9 changed files with 130 additions and 64 deletions

View File

@ -1,4 +1,13 @@
var path = require('path');
module.exports = function getOptions(argv) {
var dbOptions = argv.dbOptions;
if (typeof dbOptions === 'string') {
dbOptions = require(path.resolve(process.cwd(), argv.dbOptions));
} else if (typeof dbOptions === 'undefined') {
dbOptions = require('../defaultDbOptions.json');
}
return {
host: argv.hostname || process.env.npm_package_remotedev_hostname || null,
port: Number(argv.port || process.env.npm_package_remotedev_port) || 8000,
@ -8,8 +17,7 @@ module.exports = function getOptions(argv) {
cert: argv.cert || process.env.npm_package_remotedev_cert || null,
passphrase: argv.passphrase || process.env.npm_package_remotedev_passphrase || null
},
adapter: argv.adapter || process.env.npm_package_remotedev_adapter,
dbOptions: argv.dbOptions || process.env.npm_package_remotedev_db,
dbOptions: dbOptions,
logLevel: argv.logLevel || 3
};
}