Skip to content

Commit d9649d4

Browse files
committed
Fix import with SyntheticDefaultImports enabled
1 parent d51a88e commit d9649d4

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

library/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
};

sample-apps/nestjs-sentry/src/main.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
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

44
Sentry.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

1212
function 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() {
2323
async 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
}

0 commit comments

Comments
 (0)