fix(startup): Added hooks for async startup

This commit is contained in:
Chris Troutner
2022-06-27 10:09:08 -07:00
parent 0333f77f5a
commit f117fe15df
9 changed files with 57 additions and 8 deletions
+6
View File
@@ -79,6 +79,12 @@ class Server {
// Dev Note: This line must come BEFORE controllers.attachRESTControllers()
app.use(cors({ origin: '*' }))
// Wait for any adapters to initialize.
await this.controllers.initAdapters()
// Wait for any use-libraries to initialize.
await this.controllers.initUseCases()
// Attach REST API and JSON RPC controllers to the app.
await this.controllers.attachRESTControllers(app)