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";
|
||||
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user