🚀 release v3.0.0

This commit is contained in:
Amruth Pillai
2022-03-06 22:48:29 +01:00
parent 00505a9e5d
commit 9c1380f401
373 changed files with 12050 additions and 15783 deletions

38
server/src/main.ts Normal file
View File

@ -0,0 +1,38 @@
import { Logger, ValidationPipe } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import { NestExpressApplication } from '@nestjs/platform-express';
import cookieParser from 'cookie-parser';
import { join } from 'path';
import { AppModule } from './app.module';
const bootstrap = async () => {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
// Prefix
const globalPrefix = 'api';
app.setGlobalPrefix(globalPrefix);
// Middleware
app.enableCors({ credentials: true });
app.enableShutdownHooks();
app.use(cookieParser());
// Pipes
app.useGlobalPipes(new ValidationPipe({ transform: true }));
// Email Templates
app.setBaseViewsDir(join(__dirname, 'mail/templates'));
app.setViewEngine('hbs');
const configService = app.get(ConfigService);
const serverUrl = configService.get<number>('app.serverUrl');
const port = configService.get<number>('app.port');
await app.listen(port);
Logger.log(`🚀 Server is running on: ${serverUrl}/${globalPrefix}`);
};
bootstrap();