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",
|
"version": "16.4.5",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.5.tgz",
|
||||||
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
|
"integrity": "sha512-ZmdL2rui+eB2YwhsWzjInR8LldtZHGDoQ1ugH85ppHKwpUHL7j7rN0Ti9NCnGiQbhaZ11FpR+7ao1dNsmduNUg==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"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');
|
const mysql = require('mysql2');
|
||||||
require('dotenv').config();
|
require('dotenv').config({path:'process.env'});
|
||||||
|
|
||||||
const connection = mysql.createConnection({
|
const connection = mysql.createConnection({
|
||||||
host : process.env.DB_HOST,
|
host : process.env.DB_HOST,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ const session = require('express-session');
|
|||||||
const router = require('express').Router();
|
const router = require('express').Router();
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
|
|
||||||
require('dotenv').config();
|
require('dotenv').config({path:'process.env'});
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user