Removed hardcoded connection strings
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
|
.env
|
||||||
|
|||||||
13
package-lock.json
generated
13
package-lock.json
generated
@@ -7,6 +7,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^16.4.7",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"mariadb": "^3.3.0",
|
"mariadb": "^3.3.0",
|
||||||
"net-snmp": "^3.11.2",
|
"net-snmp": "^3.11.2",
|
||||||
@@ -190,6 +191,18 @@
|
|||||||
"npm": "1.2.8000 || >= 1.4.16"
|
"npm": "1.2.8000 || >= 1.4.16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dotenv": {
|
||||||
|
"version": "16.4.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.4.7.tgz",
|
||||||
|
"integrity": "sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==",
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://dotenvx.com"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/ee-first": {
|
"node_modules/ee-first": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"body-parser": "^1.20.2",
|
"body-parser": "^1.20.2",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
|
"dotenv": "^16.4.7",
|
||||||
"express": "^4.19.2",
|
"express": "^4.19.2",
|
||||||
"mariadb": "^3.3.0",
|
"mariadb": "^3.3.0",
|
||||||
"net-snmp": "^3.11.2",
|
"net-snmp": "^3.11.2",
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
require('dotenv').config()
|
||||||
const express = require("express");
|
const express = require("express");
|
||||||
const cors = require("cors");
|
const cors = require("cors");
|
||||||
const fs = require("node:fs");
|
const fs = require("node:fs");
|
||||||
@@ -7,9 +8,9 @@ const snmp = require("net-snmp");
|
|||||||
const bodyParser = require("body-parser");
|
const bodyParser = require("body-parser");
|
||||||
|
|
||||||
const pool = mariadb.createPool({
|
const pool = mariadb.createPool({
|
||||||
host: "localhost",
|
host: process.env.DB_HOST,
|
||||||
user: "triggeradmin",
|
user: process.env.DB_USER,
|
||||||
password: "trigger",
|
password: process.env.DB_PASS,
|
||||||
connectionLimit: 5,
|
connectionLimit: 5,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -326,4 +327,4 @@ app.get("/trigger/api/wakeDakota", (req, res) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// app is listening on port 5000
|
// app is listening on port 5000
|
||||||
app.listen(5000, "localhost", () => {});
|
app.listen(5000, '0.0.0.0', () => {});
|
||||||
|
|||||||
Reference in New Issue
Block a user