()
| 176 | } |
| 177 | |
| 178 | public async init(): Promise<this> { |
| 179 | if (this.isInitialized) { |
| 180 | return this; |
| 181 | } |
| 182 | |
| 183 | this.applyOptions(); |
| 184 | await this.httpAdapter?.init?.(); |
| 185 | |
| 186 | const useBodyParser = |
| 187 | this.appOptions && this.appOptions.bodyParser !== false; |
| 188 | useBodyParser && this.registerParserMiddleware(); |
| 189 | |
| 190 | await this.registerModules(); |
| 191 | await this.registerRouter(); |
| 192 | await this.callInitHook(); |
| 193 | await this.registerRouterHooks(); |
| 194 | await this.callBootstrapHook(); |
| 195 | |
| 196 | this.isInitialized = true; |
| 197 | this.logger.log(MESSAGES.APPLICATION_READY); |
| 198 | return this; |
| 199 | } |
| 200 | |
| 201 | public registerParserMiddleware() { |
| 202 | const prefix = this.config.getGlobalPrefix(); |
no test coverage detected