Changed database locaAdded enviroment variables

This commit is contained in:
Donavon McDowell 2024-11-29 08:46:24 -07:00
parent 7f42c32292
commit 1a6bdeff09

12
app.js
View File

@ -1,6 +1,7 @@
const express = require('express'); const express = require('express');
const mariadb = require('mariadb'); const mariadb = require('mariadb');
const cors = require('cors'); const cors = require('cors');
const dotenv = require('dotenv');
const app = express(); const app = express();
@ -9,7 +10,7 @@ app.use(cors());
const version = "V1.1"; const version = "V1.1";
const dbip = process.env.DBIP || "192.168.2.56"; const dbip = process.env.DBIP || "192.168.2.54";
const dbusername = process.env.DBUSERNAME || "root"; const dbusername = process.env.DBUSERNAME || "root";
const dbpassword = process.env.DBPASSWORD || "U&P7UH1mhRG@JF2K"; const dbpassword = process.env.DBPASSWORD || "U&P7UH1mhRG@JF2K";
const db = process.env.DB || "LicenseTracker"; const db = process.env.DB || "LicenseTracker";
@ -17,12 +18,13 @@ const db = process.env.DB || "LicenseTracker";
// Database details // Database details
const pool = mariadb.createPool({ const pool = mariadb.createPool({
host: "192.168.2.56", dbip,
user: "root", dbusername,
password: "U&P7UH1mhRG@JF2K", dbpassword,
database: "LicenseTracker" db
}); });
//Initialize pollrate variable //Initialize pollrate variable
let pollrate = "5000"; // 5 Seconds let pollrate = "5000"; // 5 Seconds