Skip to content

Commit

Permalink
fix(core): bot routers await
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed Nov 23, 2018
1 parent 655ca43 commit 0130d46
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/bp/core/server.ts
Expand Up @@ -44,11 +44,11 @@ export default class HTTPServer {
private readonly authRouter: AuthRouter
private readonly adminRouter: AdminRouter
private readonly botsRouter: BotsRouter
private readonly contentRouter: ContentRouter
private contentRouter!: ContentRouter
private readonly modulesRouter: ModulesRouter
private readonly shortlinksRouter: ShortLinksRouter
private readonly versioningRouter: VersioningRouter
private readonly converseRouter: ConverseRouter
private versioningRouter!: VersioningRouter
private converseRouter!: ConverseRouter

constructor(
@inject(TYPES.ConfigProvider) private configProvider: ConfigProvider,
Expand All @@ -57,7 +57,7 @@ export default class HTTPServer {
private logger: Logger,
@inject(TYPES.IsProduction) isProduction: boolean,
@inject(TYPES.BotRepository) botRepository: BotRepository,
@inject(TYPES.CMSService) cmsService: CMSService,
@inject(TYPES.CMSService) private cmsService: CMSService,
@inject(TYPES.FlowService) flowService: FlowService,
@inject(TYPES.ActionService) actionService: ActionService,
@inject(TYPES.ModuleLoader) moduleLoader: ModuleLoader,
Expand All @@ -67,7 +67,7 @@ export default class HTTPServer {
@inject(TYPES.LogsService) logsService: LogsService,
@inject(TYPES.NotificationsService) notificationService: NotificationsService,
@inject(TYPES.SkillService) skillService: SkillService,
@inject(TYPES.GhostService) ghostService: GhostService,
@inject(TYPES.GhostService) private ghostService: GhostService,
@inject(TYPES.LicensingService) licenseService: LicensingService,
@inject(TYPES.ConverseService) private converseService: ConverseService
) {
Expand Down Expand Up @@ -95,17 +95,17 @@ export default class HTTPServer {
adminService,
ghostService
})
this.contentRouter = new ContentRouter(this.adminService, this.authService, cmsService)
this.versioningRouter = new VersioningRouter(this.adminService, this.authService, ghostService)
this.converseRouter = new ConverseRouter(this.converseService)
this.botsRouter.router.use('/content', this.contentRouter.router)
this.botsRouter.router.use('/converse', this.converseRouter.router)
this.botsRouter.router.use('/versioning', this.versioningRouter.router)
}

@postConstruct()
async initialize() {
await this.botsRouter.initialize()
this.contentRouter = new ContentRouter(this.adminService, this.authService, this.cmsService)
this.versioningRouter = new VersioningRouter(this.adminService, this.authService, this.ghostService)
this.converseRouter = new ConverseRouter(this.converseService)
this.botsRouter.router.use('/content', this.contentRouter.router)
this.botsRouter.router.use('/converse', this.converseRouter.router)
this.botsRouter.router.use('/versioning', this.versioningRouter.router)
}

resolveAsset = file => path.resolve(process.PROJECT_LOCATION, 'assets', file)
Expand Down
5 changes: 5 additions & 0 deletions yarn.lock
Expand Up @@ -1849,6 +1849,11 @@ dedent@^0.7.0:
resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c"
integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=

deep-diff@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/deep-diff/-/deep-diff-1.0.2.tgz#afd3d1f749115be965e89c63edc7abb1506b9c26"
integrity sha512-aWS3UIVH+NPGCD1kki+DCU9Dua032iSsO43LqQpcs4R3+dVv7tX0qBGjiVHJHjplsoUM2XRO/KB92glqc68awg==

deep-extend@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
Expand Down

0 comments on commit 0130d46

Please sign in to comment.