forked from kkfive/kkapi-open
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
24 lines (24 loc) · 1.03 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const express_rate_limit_1 = require("express-rate-limit");
const http_exception_filter_1 = require("./filters/http-exception.filter");
const transform_interceptor_1 = require("./interceptor/transform.interceptor");
const core_1 = require("@nestjs/core");
const app_module_1 = require("./app.module");
const validate_pipe_1 = require("./pipe/validate.pipe");
async function bootstrap() {
const app = await core_1.NestFactory.create(app_module_1.AppModule);
app.setGlobalPrefix('/api');
app.useGlobalFilters(new http_exception_filter_1.HttpExceptionFilter());
app.enableCors();
app.useGlobalInterceptors(new transform_interceptor_1.TransformInterceptor());
app.useGlobalPipes(new validate_pipe_1.ValidationPipe());
app.set('trust proxy', 1);
app.use((0, express_rate_limit_1.default)({
windowMs: 15 * 60 * 1000,
max: 1000,
}));
await app.listen(process.env.PORT || 3000);
}
bootstrap();
//# sourceMappingURL=main.js.map