2018-03-27 21:32:07 +02:00
|
|
|
function mysql () {
|
2018-03-10 01:45:24 +01:00
|
|
|
this.database = 'default';
|
|
|
|
this.username = 'default';
|
|
|
|
this.password = 'default';
|
2018-03-13 03:26:03 +01:00
|
|
|
this.configure = (config) => {
|
|
|
|
if (!config) {
|
2018-03-13 03:33:09 +01:00
|
|
|
return console.log('No MySQL config received.');
|
2018-03-13 03:26:03 +01:00
|
|
|
}
|
2018-03-27 22:21:59 +02:00
|
|
|
console.log('configuring mysql credentials...');
|
2018-03-13 03:26:03 +01:00
|
|
|
const {database, username, password} = config;
|
|
|
|
this.database = database;
|
|
|
|
this.username = username;
|
|
|
|
this.password = password;
|
2018-03-10 01:45:24 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2018-03-27 21:32:07 +02:00
|
|
|
module.exports = new mysql();
|