import { NestFactory } from '@nestjs/core'; import { NestExpressApplication } from '@nestjs/platform-express'; import { join } from 'path'; import { AppModule } from './app.module'; import * as hbs from 'hbs'; import configuration from './configs/app'; process.env['NODE_TLS_REJECT_UNAUTHORIZED'] = '0'; async function bootstrap() { const app = await NestFactory.create(AppModule, { logger: ['debug', 'error', 'warn', 'log', 'verbose'], }); app.setBaseViewsDir(join(__dirname, '..', 'views')); app.setViewEngine('hbs'); // TODO: Продумать как правильно иницировать partial-ы в handlebars // Возможно подойдёт решение описанное тут - https://www.makeuseof.com/handlebars-nestjs-templating/ // Низкоуровневое решение по исходному коду hbs: const redminePublicUrl = configuration().redmineIssueEventEmitterConfig.redmineUrlPublic; hbs.registerPartial( 'redmineIssueAHref', `{{issue.tracker.name}} #{{issue.id}}`, ); await app.listen(process.env['PORT'] || 3000); } bootstrap();