0.0.4 • Published 2 years ago

endpoint-logger v0.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

typescript-endpoint-logger

Endpoint logger for services written in TypeScript.

Simply add the EndpointLogger middleware to the app and pass the finalized app router to BuildRouteMap(router).

The router differs depending on whether NestJS or ExpressJS is used.

NestJS

The router is not available until after the app has started.

const app = await NestFactory.create(AppModule);

// ...

app.use(EndpointLogger);
app.listen(port);

const server = app.getHttpServer();
const router = server._events.request._router;
BuildRouteMap(router);

ExpressJS

The router is available immediately on app creation.

const app = await expressApp();

// ...

app.use(EndpointLogger);
BuildRouteMap(app._router);

// ...

app.listen();
0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago