UNPKG

@apolitical/health

Version:

Node.js module to expose Apolitical's APIs health checks

41 lines (25 loc) 788 B
# Apolitical Health Node.js module to expose Apolitical's APIs health checks ## Requirements Requires the following to run: - [node.js][node] 16.13.0+ - [yarn][yarn] [node]: https://nodejs.org/en/download/ [yarn]: https://classic.yarnpkg.com/en/docs/install ## Installation Install with `yarn`: ```sh yarn add apolitical-health ``` ## Usage The `@apolitical/health` module is meant to be used from backends (server-side), no matter is the server is hosting an API or UI. First of all, include `apolitical-health` module: ``` const { checkHealth } = require('apolitical-health'); ``` The recommended way to use `checkHealth` function is: ``` await checkHealth('people-api'); ``` The first argument is the name of the API you want to check the health status. And that is it!