Initial Commit

This commit is contained in:
Constantin Simonis
2025-06-10 08:39:11 +02:00
commit b8fd37f3e0
48 changed files with 30268 additions and 0 deletions

31
backend/test/helper.ts Normal file
View File

@ -0,0 +1,31 @@
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
let connection: Connection;
let initPromise: Promise<void>;
const dbConfig = {
type: 'mysql',
host: 'localhost',
port: 3306,
username: 'root',
password: '',
database: '',
synchronise: false,
entities: [''],
} as ConnectionOptions;
export function initConnection() {
if (initPromise) {
return initPromise;
}
initPromise = createConnection(dbConfig).then((con) => {
connection = con;
}).catch((error) => { throw error; });
return initPromise;
}
export function stopConnection(): Promise<void> {
return connection.close();
}