File tree Expand file tree Collapse file tree 2 files changed +19
-7
lines changed
sample-apps/nestjs-sentry/src Expand file tree Collapse file tree 2 files changed +19
-7
lines changed Original file line number Diff line number Diff line change @@ -25,3 +25,13 @@ export {
2525 addFastifyHook ,
2626 addKoaMiddleware ,
2727} ;
28+
29+ export default {
30+ setUser,
31+ shouldBlockRequest,
32+ addExpressMiddleware,
33+ addHonoMiddleware,
34+ addHapiMiddleware,
35+ addFastifyHook,
36+ addKoaMiddleware,
37+ } ;
Original file line number Diff line number Diff line change 1- import ' @aikidosec/firewall' ;
2- import * as Sentry from ' @sentry/nestjs' ;
1+ import Zen from " @aikidosec/firewall" ;
2+ import * as Sentry from " @sentry/nestjs" ;
33
44Sentry . init ( {
5- dsn : ' https://examplePublicKey@o0.ingest.sentry.io/0' ,
5+ dsn : " https://examplePublicKey@o0.ingest.sentry.io/0" ,
66} ) ;
77
8- import { NestFactory } from ' @nestjs/core' ;
9- import { AppModule } from ' ./app.module' ;
10- import { ZenGuard } from ' ./zen.guard' ;
8+ import { NestFactory } from " @nestjs/core" ;
9+ import { AppModule } from " ./app.module" ;
10+ import { ZenGuard } from " ./zen.guard" ;
1111
1212function getPort ( ) {
1313 const port = parseInt ( process . env . PORT , 10 ) || 4000 ;
1414
1515 if ( isNaN ( port ) ) {
16- console . error ( ' Invalid port' ) ;
16+ console . error ( " Invalid port" ) ;
1717 process . exit ( 1 ) ;
1818 }
1919
@@ -23,6 +23,8 @@ function getPort() {
2323async function bootstrap ( ) {
2424 const app = await NestFactory . create ( AppModule ) ;
2525
26+ Zen . addExpressMiddleware ( app ) ;
27+
2628 app . useGlobalGuards ( new ZenGuard ( ) ) ;
2729 await app . listen ( getPort ( ) ) ;
2830}
You can’t perform that action at this time.
0 commit comments