Aktualisiere Datenbankverbindung mit Umgebungsvariablen und ändere Host-Adresse

This commit is contained in:
2025-03-17 21:36:22 +01:00
parent c6665ae8ac
commit 0d917e9ed3
3 changed files with 11 additions and 7 deletions

View File

@@ -1,19 +1,21 @@
const mySql = require("mysql2");
const UserManager = require("./UserManager/UserManager");
require("dotenv").config();
class DataBaseManager {
constructor(host, database) {
this.connection = mySql.createConnection({
host: host,
port: 3210,
port: process.env.DB_PORT,
user: "root",
password: "Jonas2007",
password: process.env.DB_PASSWORD,
database: database
});
this.connection.connect((err) => {
if (err) {
throw err;
}
});