INNER CODE UNIT · TypeScript
bootstrap
marcomelilli/nestjs-email-authentication · src/main.ts:12
async function bootstrap() {
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.use('/public', express.static(join(__dirname, '../../public')));
var bodyParser = require('body-parser');
app.use(bodyParser.json({limit: '5mb'}));
app.use(bodyParser.urlencoded({limit: '5mb', extended: true}));
app.useGlobalFilters(new AllExceptionsFilter());
/* SECURITY */
app.enable("trust proxy");
app.use(helmet());
app.use(rateLimit({
windowMs: 15 * 60 * 1000, // 15 minutes
max: 100, // limit each IP to 100 requests per windowMs
message:
"Too many requests from this IP, please try again later"
}));