From 8ac8ed07abba02f641a028c5dc1c28c4eae681b2 Mon Sep 17 00:00:00 2001 From: Brandon Rodriguez <brodriguez8774@gmail.com> Date: Wed, 16 Dec 2020 01:44:50 -0500 Subject: [PATCH] Move config to project root --- app.js | 4 +--- src/config.js => config.js | 2 +- readme.md | 9 +++++---- 3 files changed, 7 insertions(+), 8 deletions(-) rename src/config.js => config.js (81%) diff --git a/app.js b/app.js index ae5d11a..b77fb29 100644 --- a/app.js +++ b/app.js @@ -5,7 +5,7 @@ // System Imports. // User Imports. -const config = require('./src/config.js'); +const config = require('./config.js'); const { userConfirmation } = require('./src/helper_functions.js'); const testLogLevels = require('./src/logging.js'); const MySql = require('./src/mysql.js'); @@ -38,8 +38,6 @@ async function main() { mysql.reset_db(); mysql.close_conn(); - - console.log(''); console.info('Terminating program.'); diff --git a/src/config.js b/config.js similarity index 81% rename from src/config.js rename to config.js index e5e44af..610de8a 100644 --- a/src/config.js +++ b/config.js @@ -7,7 +7,7 @@ var config = { mysql: { host: '127.0.0.1', port: '3306', - database: 'mysql_bot_example', + database: 'mysql_connector_example', user: 'root', password: 'root' } diff --git a/readme.md b/readme.md index ef42fde..96b5d35 100755 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# JavaScript - NodeJS MySql Example +# JavaScript - NodeJS MySql Connector Example ## Description @@ -6,10 +6,11 @@ Example of using a NodeJS JavaScript application to connect to MySQL and make da ## Program Setup -First, make sure MySQL is installed and setup on your program. Then install NodeJs. +First, make sure MySQL is installed and setup on your program. Then install NodeJs and run `npm install` from project +root. -Once that's done, import `<project_root>/src/database_export.sql` to a new database, edit `<project_root>/src/config.js` -to connect to your local MySql instance. +Once that's done, import `src/database_export.sql` to a new database, and edit `config.js` to connect to your local +MySql instance. ## Running the Program -- GitLab