Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

lightship

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lightship

Abstracts readiness/ liveness checks and graceful shutdown of Node.js services running in Kubernetes.

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
61K
decreased by-12.74%
Maintainers
1
Weekly downloads
 
Created
Source

express-process-manager

Travis build status NPM version Canonical Code Style Twitter Follow

Abstracts initialisation and shutdown of Express.js services.

Disclaimer: I just needed something that works for my Kubernetes setup. This is far from a customisable service that could work across many projects in different environments.

Behaviour

Creates /healthz health-check endpoint.

The health-check endpoint responds:

  • 500 status code, message "SERVER IS NOT READY" when server is initialising.
  • 500 status code, message "SERVER IS SHUTTING DOWN" when server is shutting down.
  • 200 status code, message "SERVER IS READY" when server is accepting new connections.

The default behaviour is:

  • Service becomes ready 5 seconds after initialisation of the process manager.
  • Service enters graceful shutdown after receiving SIGTERM. Service shutdowns after 5 seconds.

Usage

import express from 'express';
import {
  createProcessManager
} from 'express-process-manager';

const app = express();

const server = app.listen(8080);

createProcessManager(server, app);

Kubernetes readiness and liveness probe configuration

readinessProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 5
  initialDelaySeconds: 5
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  periodSeconds: 5
  initialDelaySeconds: 10

Logging

express-process-manager is using Roarr to implement logging.

Set ROARR_LOG=true environment variable to enable logging.

Keywords

FAQs

Package last updated on 30 Jun 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc