From 67434d0f39a3d791bb5c1d964fade8f74ec89fb9 Mon Sep 17 00:00:00 2001 From: Andru Cherny Date: Tue, 12 May 2020 14:47:12 +0300 Subject: [PATCH] fix: [ApiServer] enabled flag --- app/src/Modules/Api/index.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/src/Modules/Api/index.ts b/app/src/Modules/Api/index.ts index caabeb08..4b676e99 100644 --- a/app/src/Modules/Api/index.ts +++ b/app/src/Modules/Api/index.ts @@ -52,12 +52,12 @@ export class ApiServer { } public listen(): Promise { - + if (!this.config.enabled) { + Core.info('Module ApiServer is not enabled'); + return Promise.resolve(this); + } return new Promise((resolve, reject) => { - if (!this.config.enabled) { - Core.info('Module ApiServer is not enabled'); - resolve(this); - } + this.koa.use(async (ctx, next) => { try { await next();