added environment variables
This commit is contained in:
parent
f2d21b63df
commit
c5ff3857c7
1
package-lock.json
generated
1
package-lock.json
generated
@ -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"
|
||||
},
|
||||
|
||||
@ -1 +1,8 @@
|
||||
APP_PORT = 3000
|
||||
# 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=
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user