Newer
Older

Lukáš Kratochvíl
committed
import { ConfigService } from '@nestjs/config';
async function bootstrap(): Promise<void> {
const app = await NestFactory.create(AppModule);

Lukáš Kratochvíl
committed
const configService = app.get(ConfigService);
app.useGlobalPipes(
new ValidationPipe({
transform: true,
}),
);

Lukáš Kratochvíl
committed
const port = configService.get<number>('PORT') | 4000;
console.log(`NestJS server is listening on: http://localhost:${port}`);
await app.listen(port);