From a1e3289a88a61ee0bf574f5c674ee4ea6c06a9f8 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Sat, 12 Dec 2020 12:39:53 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fixed=20app.ts=20for=20productio?= =?UTF-8?q?n=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ref #24 --- src/app.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index 588d6a1..9adc9b3 100644 --- a/src/app.ts +++ b/src/app.ts @@ -6,13 +6,14 @@ import { config, e as errors } from './config'; import loaders from "./loaders/index"; import { ErrorHandler } from './middlewares/ErrorHandler'; +const CONTROLLERS_FILE_EXTENSION = process.env.NODE_ENV === 'production' ? 'js' : 'ts'; const app = createExpressServer({ authorizationChecker: authchecker, middlewares: [ErrorHandler], development: config.development, cors: true, routePrefix: "/api", - controllers: [__dirname + "/controllers/*.ts"], + controllers: [`${__dirname}/controllers/*.${CONTROLLERS_FILE_EXTENSION}`], }); async function main() {