mirror of
https://github.com/donavon04/licensetrackerbackend.git
synced 2025-01-18 08:40:57 -07:00
Changed database locaAdded enviroment variables
This commit is contained in:
parent
7f42c32292
commit
1a6bdeff09
12
app.js
12
app.js
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user