This repository has been archived on 2023-09-06. You can view files and clone it, but cannot push or open issues or pull requests.
vn-softphone/database.js

22 lines
444 B
JavaScript

var mysql = require('mysql');
let config = require('./config.js');
module.exports = {
/**
* Pool instance
*/
pool: null,
/**
* Start database pool
*/
init: function() {
this.pool = mysql.createPool(config.mysql);
this.pool.getConnection(function(error, connection) {
if (error)
throw new Error('Can\'t connect to database: ' + error.code);
});
}
};