/*
 * Copyright (c) 2017 Node7 Team
 *
 * Licensed under MIT (https://github.com/tienthanh2509/isc-node7/blob/master/LICENSE)
 */

var mysql = require("mysql");

// Thiết lập kết nối CSDL dùng Connection
var connection = mysql.createConnection({
 host: process.env.DB_HOST || 'localhost',
 user: process.env.DB_USER || 'root',
 port: process.env.DB_PORT || '3306',
 password: process.env.DB_PASSWORD || '',
 database: process.env.DB_DATABASE || 'qlns'
});

connection.connect(function(){
    console.log('connect success');
});

module.exports = connection;
@@ -205,46 +205,24 @@
 var 
-connection = mysql.createConnection(%7B%0A
+dbConfig = %7B%0A   
  hos
@@ -260,16 +260,19 @@
 lhost',%0A
+   
  user: p
@@ -301,16 +301,19 @@
 'root',%0A
+   
  port: p
@@ -342,16 +342,19 @@
 '3306',%0A
+   
  passwor
@@ -387,16 +387,19 @@
  %7C%7C '',%0A
+   
  databas
@@ -433,15 +433,70 @@
 %7C%7C '
-qlns'%0A%7D
+isc-node7'%0A%7D;%0Avar connection = mysql.createConnection(dbConfig
 );%0A%0A
@@ -526,10 +526,12 @@
 tion
+ 
 ()
+ 
 %7B%0A  
@@ -549,24 +549,87 @@
 og('
-connect success'
+%5BDB%5D Connected to ' + dbConfig.user + '@' + dbConfig.host + ':' + dbConfig.port
 );%0A%7D

Update db model