@rfprodz/backend-diagnostics
v1.0.39
Published
NestJS API diagnostics module.
Downloads
11
Maintainers
Readme
backend-diagnostics
Diagnostics module for NestJS backends.
Developer commands reference
npx nx run tools:help --search backend-diagnostics:
Usage
Add to the root API module
...
@Module({
...
imports: [
...
HttpModule.registerAsync({
useFactory: () => ({
timeout: 10000,
maxRedirects: 5,
}),
}),
AppDiagnosticsModule.forRoot(),
...
],
...
})
export class AppApiModule {}
Add to the main.ts
file
/**
* Express server.
*/
const server: e.Express = e();
...
async function bootstrap(expressInstance: e.Express): Promise<INestApplication> {
const app = await NestFactory.create(AppApiModule, new ExpressAdapter(expressInstance));
app.useWebSocketAdapter(new WsAdapter(app));
...
return app.init();
}
void bootstrap(server);