diff --git a/apps/server/src/apps/admin-api-server.app.ts b/apps/server/src/apps/admin-api-server.app.ts index 3fcd3d31927..4bcbf9681b6 100644 --- a/apps/server/src/apps/admin-api-server.app.ts +++ b/apps/server/src/apps/admin-api-server.app.ts @@ -12,38 +12,32 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib'; async function bootstrap() { sourceMapInstall(); - const enabled = Configuration.get('ADMIN_API__ENABLED') as boolean; - - if (enabled) { - const nestAdminServerExpress = express(); - const nestAdminServerExpressAdapter = new ExpressAdapter(nestAdminServerExpress); - nestAdminServerExpressAdapter.disable('x-powered-by'); - - const nestAdminServerApp = await NestFactory.create(AdminApiServerModule, nestAdminServerExpressAdapter); - const logger = await nestAdminServerApp.resolve(Logger); - const legacyLogger = await nestAdminServerApp.resolve(LegacyLogger); - nestAdminServerApp.useLogger(legacyLogger); - nestAdminServerApp.enableCors(); - - enableOpenApiDocs(nestAdminServerApp, 'docs'); - nestAdminServerApp.setGlobalPrefix('/admin/api/v1'); - - await nestAdminServerApp.init(); - - const adminApiServerPort = Configuration.get('ADMIN_API__PORT') as number; - - nestAdminServerExpress.listen(adminApiServerPort, () => { - logger.info( - new AppStartLoggable({ - appName: 'Admin API server app', - port: adminApiServerPort, - mountsDescription: `/admin/api/v1 --> Admin API Server`, - }) - ); - }); - } else { - process.exit(0); - } + const nestAdminServerExpress = express(); + const nestAdminServerExpressAdapter = new ExpressAdapter(nestAdminServerExpress); + nestAdminServerExpressAdapter.disable('x-powered-by'); + + const nestAdminServerApp = await NestFactory.create(AdminApiServerModule, nestAdminServerExpressAdapter); + const logger = await nestAdminServerApp.resolve(Logger); + const legacyLogger = await nestAdminServerApp.resolve(LegacyLogger); + nestAdminServerApp.useLogger(legacyLogger); + nestAdminServerApp.enableCors(); + + enableOpenApiDocs(nestAdminServerApp, 'docs'); + nestAdminServerApp.setGlobalPrefix('/admin/api/v1'); + + await nestAdminServerApp.init(); + + const adminApiServerPort = Configuration.get('ADMIN_API__PORT') as number; + + nestAdminServerExpress.listen(adminApiServerPort, () => { + logger.info( + new AppStartLoggable({ + appName: 'Admin API server app', + port: adminApiServerPort, + mountsDescription: `/admin/api/v1 --> Admin API Server`, + }) + ); + }); } void bootstrap();