NEST CORE TOOLKIT
Usage
Logger
Cache
Register in main.ts
async function bootstrap() {
const app = await NestFactory.create(AppModule, {
logger: new Logger(),
});
app.useGlobalFilters(app.get(ServerExceptionFilter));
app.useGlobalFilters(app.get(HttpExceptionFilter));
app.useGlobalInterceptors(app.get(PerformanceInterceptor));
app.useGlobalInterceptors(app.get(LimitationInterceptor));
app.useGlobalInterceptors(app.get(AuthInterceptor));
app.useGlobalInterceptors(app.get(ResponseInterceptor));
await app.listen(3001);
}
bootstrap();
Register in app.module.ts
@Module({
imports: [
],
exports: [],
controllers: [],
providers: [
HttpExceptionFilter,
ServerExceptionFilter,
LimitationInterceptor,
ResponseInterceptor,
PerformanceInterceptor,
CacheInterceptor,
ValidatorPipe,
],
})
Build
tsc