Added ORM entities
This commit is contained in:
@ -8,6 +8,7 @@ import cors from 'cors'
|
||||
import { Server as SocketServer } from 'socket.io'
|
||||
import { Authentication } from './middleware/authentication'
|
||||
import { TSocket } from './utilities/types'
|
||||
import { MikroORM } from '@mikro-orm/mariadb'
|
||||
import prisma from './utilities/prisma'
|
||||
import { appLogger, watchLogs } from './utilities/logger'
|
||||
import ZoneManager from './managers/zoneManager'
|
||||
@ -57,6 +58,14 @@ export class Server {
|
||||
appLogger.error(`Database connection failed: ${error.message}`)
|
||||
}
|
||||
|
||||
// MikroORM
|
||||
try {
|
||||
const orm = await MikroORM.init();
|
||||
appLogger.info('Database 2 connected')
|
||||
} catch (error: any) {
|
||||
appLogger.error(`Database 2 connection failed: ${error.message}`)
|
||||
}
|
||||
|
||||
// Start the server
|
||||
try {
|
||||
this.http.listen(config.PORT, config.HOST)
|
||||
|
Reference in New Issue
Block a user