Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
toonvanstrijp committed Sep 6, 2022
1 parent f8db61f commit 8b998ab
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/guides/exception-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,26 @@ import { I18nMiddleware } from 'nestjs-i18n';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
app.use(I18nMiddleware);
await app.listen(3001);
await app.listen(3000);
}
bootstrap();
```

or

```typescript title="src/app.module.ts"
import { MiddlewareConsumer, Module, NestModule } from '@nestjs/common';
import { I18nMiddleware } from 'nestjs-i18n';

@Module({
...
})
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(I18nMiddleware, MyMiddleware).forRoutes('*');
}
}

```

:::

0 comments on commit 8b998ab

Please sign in to comment.