From ba82eeb17abba234928f8c7b3d10d8a6fa2efc4a Mon Sep 17 00:00:00 2001 From: donavon04 Date: Fri, 29 Nov 2024 09:34:36 -0700 Subject: [PATCH] Modified the database connection to work properly lol --- app.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app.js b/app.js index 417193e..5314403 100644 --- a/app.js +++ b/app.js @@ -10,18 +10,19 @@ app.use(cors()); const version = "V1.1"; +// Database configuration from environment variables or defaults const dbip = process.env.DBIP || "192.168.2.55"; const dbusername = process.env.DBUSERNAME || "root"; const dbpassword = process.env.DBPASSWORD || "U&P7UH1mhRG@JF2K"; const db = process.env.DB || "LicenseTracker"; - -// Database details +// Create a MariaDB connection pool const pool = mariadb.createPool({ - dbip, - dbusername, - dbpassword, - db + host: dbip, + user: dbusername, + password: dbpassword, + database: db, + connectionLimit: 5 // Optional: Limit for maximum simultaneous connections }); //Initialize pollrate variable