@vp_solutions/express-skeleton-health-module
v1.3.7
Published
Health module for Express Skeleton
Downloads
1
Readme
Health module for @vp_solutions/express-skeleton
Module description
Example of usage with Inversify IoC container:
Health module is inversify container module that contain instances of Health Controller, Service and Router.
For adding it in your project you have to import getHealthModule()
function which returns container module.
Then just load this module into your app container and add Health Router in your routes chain.
// app-container.ts
import { Container } from 'inversify';
import { getHealthModule } from '@vp_solutions/express-skeleton-health-module';
const appContainer = new Container();
appContainer.load(getHealthModule());
// app.ts
import * as express from 'express';
import { appContainer } from './app-container.ts'
import { getExpressErrorHandler } from '@vp_solutions/errors';
import { BaseRouter } from '@vp_solutions/express-skeleton-common-module';
import { HEALTH_ROUTER } from '@vp_solutions/express-skeleton-health-module';
import { ILoggerService, LOGGER_SERVICE } from '@vp_solutions/express-skeleton-logger-module';
const app = express();
app.use('/health', appContainer.get<BaseRouter>(HEALTH_ROUTER).router);
app.use(getExpressErrorHandler(appContainer.get<ILoggerService>(LOGGER_SERVICE)));