diff --git a/app.js b/app.js index 8839896fd333cfbb2f2c3dd526715668b26163e7..8db8fd5edad7c239deae6f1ef4e26318fbb26daf 100644 --- a/app.js +++ b/app.js @@ -2,6 +2,9 @@ * NodeJS application to connect to MySQL and make database queries. */ +// User Imports. +import config from './src/config.js'; + /** * Program start. @@ -10,6 +13,8 @@ function main() { console.log('Starting program.'); console.log(''); + console.log(config['mysql']); + console.log(''); console.log('Terminating program.'); } diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..8d3487b11324cb48324d8f5006f60e5123fdb802 --- /dev/null +++ b/package.json @@ -0,0 +1,10 @@ +{ + "name": "mysql_bot_example", + "version": "1.0.0", + "description": "Test NodeJS application to connect to MySQL and make database queries.", + "main": "app.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "type": "module" +} diff --git a/readme.md b/readme.md index a177cf6c59523ac0c426e4e77236744deaab7357..ef42fdea028acae9fa594b9f7a59ed03dfe20b6e 100755 --- a/readme.md +++ b/readme.md @@ -3,3 +3,14 @@ ## Description Example of using a NodeJS JavaScript application to connect to MySQL and make database queries. + + +## Program Setup +First, make sure MySQL is installed and setup on your program. Then install NodeJs. + +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. + + +## Running the Program +Once the program is setup, use a terminal to cd into project root, then run `node app.js`.