From 5003dcd8b24ce7e07b40bd8ca8a62648a1c273e5 Mon Sep 17 00:00:00 2001 From: moepoi Date: Mon, 15 Nov 2021 17:35:31 +0700 Subject: [PATCH] Revert some changes --- .gitignore | 2 +- conf.js => config.js.example | 2 +- modules/db.js | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) rename conf.js => config.js.example (88%) diff --git a/.gitignore b/.gitignore index a5bcd88..70cf9ed 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,4 @@ Temporary Items .apdisk # Config -conf.js \ No newline at end of file +config.js \ No newline at end of file diff --git a/conf.js b/config.js.example similarity index 88% rename from conf.js rename to config.js.example index 4da8f5b..8892d2a 100644 --- a/conf.js +++ b/config.js.example @@ -9,4 +9,4 @@ const config = { }, }; -module.exports = config; +module.exports = config; \ No newline at end of file diff --git a/modules/db.js b/modules/db.js index b08ab1d..a5e9483 100644 --- a/modules/db.js +++ b/modules/db.js @@ -1,5 +1,10 @@ var mysql = require('mysql2'); -const config = require('../conf'); + +try { + const config = require('../config'); +} catch (e) { + console.log('No config file found'); +} function connect() { const connection = mysql.createConnection(config.db);