UNPKG

@godaddy/terminus

Version:

[![Join Slack](https://img.shields.io/badge/Join%20us%20on-Slack-e01563.svg)](https://godaddy-oss.slack.com/) [![Build Status](https://github.com/godaddy/terminus/actions/workflows/cicd.yml/badge.svg)](https://github.com/godaddy/terminus/actions/workflows

19 lines (15 loc) 453 B
'use strict' const http = require('http') const server = http.createServer((req, res) => res.end('hello')) const { createTerminus } = require('../../') createTerminus(server, { healthChecks: { '/health': () => Promise.reject(new Error('failure')) }, onSendFailureDuringShutdown: async () => { console.log('onSendFailureDuringShutdown') } }) server.listen(8000, () => { setTimeout(() => process.kill(process.pid, 'SIGTERM'), 600) })