MCPcopy
hub / github.com/adonisjs/core / registerServer

Method registerServer

providers/app_provider.ts:216–226  ·  view source on GitHub ↗

* 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

()

Source from the content-addressed store, hash-verified

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

Callers 1

registerMethod · 0.95

Calls 1

makeMethod · 0.80

Tested by

no test coverage detected