Removed hardcoded connection strings

This commit is contained in:
2024-12-04 16:52:51 -06:00
parent aabb813b45
commit 8b82b252bb
4 changed files with 825 additions and 809 deletions

1
.gitignore vendored
View File

@@ -1 +1,2 @@
/node_modules/
.env

13
package-lock.json generated
View File

@@ -7,6 +7,7 @@
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^4.19.2",
"mariadb": "^3.3.0",
"net-snmp": "^3.11.2",
@@ -190,6 +191,18 @@
"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": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",

View File

@@ -2,6 +2,7 @@
"dependencies": {
"body-parser": "^1.20.2",
"cors": "^2.8.5",
"dotenv": "^16.4.7",
"express": "^4.19.2",
"mariadb": "^3.3.0",
"net-snmp": "^3.11.2",

View File

@@ -1,3 +1,4 @@
require('dotenv').config()
const express = require("express");
const cors = require("cors");
const fs = require("node:fs");
@@ -7,9 +8,9 @@ const snmp = require("net-snmp");
const bodyParser = require("body-parser");
const pool = mariadb.createPool({
host: "localhost",
user: "triggeradmin",
password: "trigger",
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASS,
connectionLimit: 5,
});
@@ -326,4 +327,4 @@ app.get("/trigger/api/wakeDakota", (req, res) => {
});
// app is listening on port 5000
app.listen(5000, "localhost", () => {});
app.listen(5000, '0.0.0.0', () => {});