diff --git a/package-lock.json b/package-lock.json index 6a8b103..3460d88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -172,6 +172,7 @@ "version": "16.4.5", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz", "integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==", + "license": "BSD-2-Clause", "engines": { "node": ">=12" }, diff --git a/process.env b/process.env index 57eaaf2..840a0a6 100644 --- a/process.env +++ b/process.env @@ -1 +1,8 @@ -APP_PORT = 3000 \ No newline at end of file +# configuration for web app +APP_PORT=3000 + +# configuration for db access +DB_HOST=172.0.0.1:3306 +DB_USER=root +DB_PASSWORD= +DB_DATABASE= diff --git a/scripts/modules/db-connect.js b/scripts/modules/db-connect.js index e860644..00b0540 100644 --- a/scripts/modules/db-connect.js +++ b/scripts/modules/db-connect.js @@ -1,5 +1,5 @@ const mysql = require('mysql2'); -require('dotenv').config(); +require('dotenv').config({path:'process.env'}); const connection = mysql.createConnection({ host : process.env.DB_HOST, diff --git a/server.js b/server.js index b744806..8f83748 100644 --- a/server.js +++ b/server.js @@ -3,7 +3,7 @@ const session = require('express-session'); const router = require('express').Router(); const path = require('path'); -require('dotenv').config(); +require('dotenv').config({path:'process.env'}); const app = express();