diff --git a/db.js b/db.js deleted file mode 100644 index 047dc94..0000000 --- a/db.js +++ /dev/null @@ -1,16 +0,0 @@ -var mysql = require("mysql"); -var db_connect = mysql.createConnection({ - host: "ruka.moe.team", - user: "admin_nekoya", - password: "Nekoya123.", - database: "admin_nekoya", -}); -db_connect.connect(function (err) { - if (!err) { - console.log("Database Connected !!!"); - } else { - console.log("There was a problem connecting to the database ...."); - } -}); - -module.exports = db_connect; diff --git a/modules/db.js b/modules/db.js new file mode 100644 index 0000000..0681931 --- /dev/null +++ b/modules/db.js @@ -0,0 +1,11 @@ +var mysql = require('mysql2'); +const config = require('../config'); + +function connect(sql, params) { + const connection = mysql.createConnection(config.db); + return connection; +} + +module.exports = { + connect +} \ No newline at end of file