mirror of
https://github.com/donavon04/licensetrackerbackend.git
synced 2025-01-18 00:30:57 -07:00
Modified the database connection to work properly lol
This commit is contained in:
parent
f5a9ef016a
commit
ba82eeb17a
13
app.js
13
app.js
@ -10,18 +10,19 @@ app.use(cors());
|
|||||||
|
|
||||||
const version = "V1.1";
|
const version = "V1.1";
|
||||||
|
|
||||||
|
// Database configuration from environment variables or defaults
|
||||||
const dbip = process.env.DBIP || "192.168.2.55";
|
const dbip = process.env.DBIP || "192.168.2.55";
|
||||||
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";
|
||||||
|
|
||||||
|
// Create a MariaDB connection pool
|
||||||
// Database details
|
|
||||||
const pool = mariadb.createPool({
|
const pool = mariadb.createPool({
|
||||||
dbip,
|
host: dbip,
|
||||||
dbusername,
|
user: dbusername,
|
||||||
dbpassword,
|
password: dbpassword,
|
||||||
db
|
database: db,
|
||||||
|
connectionLimit: 5 // Optional: Limit for maximum simultaneous connections
|
||||||
});
|
});
|
||||||
|
|
||||||
//Initialize pollrate variable
|
//Initialize pollrate variable
|
||||||
|
Loading…
Reference in New Issue
Block a user