🐞 fixed app.ts for production use

ref #24
This commit is contained in:
Philipp Dormann 2020-12-12 12:39:53 +01:00
parent 47e4f6cd7e
commit a1e3289a88
1 changed files with 2 additions and 1 deletions

View File

@ -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() {