change to unindented config definition
parent
e04eedb2c4
commit
b2cf8cf336
|
@ -8,12 +8,10 @@
|
||||||
"invite_code": "top-sekrit",
|
"invite_code": "top-sekrit",
|
||||||
|
|
||||||
"storage_type": "postgres",
|
"storage_type": "postgres",
|
||||||
"storage_config": {
|
"storage_postgres_host": "localhost",
|
||||||
"host": "localhost",
|
"storage_postgres_database": "spacedeck",
|
||||||
"database": "spacedeck",
|
"storage_postgres_username": "postgres",
|
||||||
"username": "postgres",
|
"storage_postgres_password": "postgres",
|
||||||
"password": "postgres"
|
|
||||||
},
|
|
||||||
|
|
||||||
"storage_local_path": "./storage",
|
"storage_local_path": "./storage",
|
||||||
"storage_local_db": "./database.sqlite",
|
"storage_local_db": "./database.sqlite",
|
||||||
|
|
32
models/db.js
32
models/db.js
|
@ -10,20 +10,24 @@ let sequelize;
|
||||||
|
|
||||||
if(config.has('storage_type') && config.get('storage_type') === 'postgres') {
|
if(config.has('storage_type') && config.get('storage_type') === 'postgres') {
|
||||||
console.log('connecting to postgres');
|
console.log('connecting to postgres');
|
||||||
let postgresConfig = config.get('storage_config');
|
sequelize = new Sequelize(
|
||||||
sequelize = new Sequelize(postgresConfig.database, postgresConfig.username, postgresConfig.password, {
|
config.get('storage_postgres_database'),
|
||||||
host: postgresConfig.host,
|
config.get('storage_postgres_username'),
|
||||||
dialect: 'postgres',
|
config.get('storage_postgres_password'),
|
||||||
pool: {
|
{
|
||||||
max: 5,
|
host: config.get('storage_postgres_host'),
|
||||||
min: 0,
|
dialect: 'postgres',
|
||||||
acquire: 30000,
|
pool: {
|
||||||
idle: 10000
|
max: 5,
|
||||||
},
|
min: 0,
|
||||||
logging: sequel_log,
|
acquire: 30000,
|
||||||
// http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
|
idle: 10000
|
||||||
operatorsAliases: false
|
},
|
||||||
});
|
logging: sequel_log,
|
||||||
|
// http://docs.sequelizejs.com/manual/tutorial/querying.html#operators
|
||||||
|
operatorsAliases: false
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('connecting to sqlite');
|
console.log('connecting to sqlite');
|
||||||
|
|
Loading…
Reference in New Issue