mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 07:07:21 +00:00
33 lines
687 B
TypeScript
33 lines
687 B
TypeScript
import { NestFactory } from '@nestjs/core';
|
|
import { AuthModule } from './auth.module';
|
|
import rateLimit from 'express-rate-limit';
|
|
import helmet from 'helmet';
|
|
import { setupSwaggerAuthentication } from '@app/common/util/user-auth.swagger.utils';
|
|
import { ValidationPipe } from '@nestjs/common';
|
|
|
|
async function bootstrap() {
|
|
const app = await NestFactory.create(AuthModule);
|
|
|
|
app.enableCors();
|
|
|
|
app.use(
|
|
rateLimit({
|
|
windowMs: 5 * 60 * 1000,
|
|
max: 500,
|
|
}),
|
|
);
|
|
|
|
app.use(
|
|
helmet({
|
|
contentSecurityPolicy: false,
|
|
}),
|
|
);
|
|
|
|
setupSwaggerAuthentication(app);
|
|
|
|
app.useGlobalPipes(new ValidationPipe());
|
|
|
|
await app.listen(6001);
|
|
}
|
|
bootstrap();
|