spee.ch/config/mysqlConfig.js

21 lines
505 B
JavaScript
Raw Normal View History

2018-03-29 21:33:52 +02:00
const logger = require('winston');
function mysql () {
2018-03-29 21:33:52 +02:00
this.database = 'default';
this.username = 'default';
this.password = 'default';
2018-03-29 21:46:20 +02:00
this.update = (config) => {
2018-03-29 21:33:52 +02:00
if (!config) {
return logger.warn('No MySQL config received.');
2018-03-13 03:26:03 +01:00
}
2018-03-28 01:08:01 +02:00
// configure credentials
2018-03-29 21:33:52 +02:00
logger.info('configuring mysql...');
const { database, username, password } = config;
this.database = database;
this.username = username;
this.password = password;
};
};
module.exports = new mysql();