-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.ts
35 lines (30 loc) · 939 Bytes
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { RoomService } from '@/api/services/RoomService'
import { ENV, PORT } from '@/config/Env'
import '@/config/Ioc'
import '@/config/Logger'
import { server } from '@/config/Socket.io'
import { database } from '@/database'
import { PluginManager } from '@/shared/PluginManager'
import 'reflect-metadata'
import Container from 'typedi'
/**
* Initializes the application.
*
* @function
*/
(async () => {
console.clear()
try {
await database()
await Container.get(RoomService).load()
await PluginManager.loadAll()
server.listen(PORT)
console.log('----------------------------------------')
console.info(`Environment: ${ENV}`)
console.info(`Base URL: http://localhost:${PORT}`)
console.info(`WebSocket: http://localhost:${PORT}/socket.io`)
console.log('----------------------------------------')
} catch (error) {
console.error(`Initializing failed! Reason: ${error.stack}`)
}
})()