* Registers the HTTP server with the container as a singleton * * Creates a singleton binding for the HTTP server that handles * incoming requests, with dependencies on encryption, emitter, * logger, and HTTP configuration. * * @example * const server = await container.make('ser
()
| 214 | * server.start() |
| 215 | */ |
| 216 | protected registerServer() { |
| 217 | this.app.container.singleton(Server, async (resolver) => { |
| 218 | const encryption = await resolver.make(Encryption) |
| 219 | const emitter = await resolver.make('emitter') |
| 220 | const logger = await resolver.make('logger') |
| 221 | const config = this.app.config.get<any>('app.http') |
| 222 | return new Server(this.app, encryption, emitter, logger, config) |
| 223 | }) |
| 224 | |
| 225 | this.app.container.alias('server', Server) |
| 226 | } |
| 227 | |
| 228 | /** |
| 229 | * Registers router with the container as a singleton |