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

@gquittet/graceful-server

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gquittet/graceful-server

Tiny (~5k), dependency-free Node.JS library to make your API more graceful

  • 5.2.6
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

🚀 Graceful Server 🐢

GitHub package.json version JavaScript Style Guide npm type definitions License npmjs download Donate with PayPal

Tiny (~5k), KISS, dependency-free Node.JS library to make your Rest API graceful.


Features

✔ It's listening system events to gracefully close your API on interruption.

✔ It facilitates the disconnect of data sources on shutdown.

✔ It facilitates the use of liveness and readiness.

✔ It manages the connections of your API.

✔ It avoid boilerplate codes.

✔ Kubernetes compliant.

✔ Dependency-free.

✔ KISS code base.

Requirements

✔ NodeJS >= 18.0

Installation

NPM

npm install --save @gquittet/graceful-server

PNPM

pnpm add @gquittet/graceful-server

YARN

yarn add @gquittet/graceful-server

Endpoint

Below you can find the default endpoint but you can setup or disable them. To do that, check out the Options part.

/live

The endpoint responds:

  • 200 status code with the uptime of the server in second.
{ "uptime": 42 }

Used to configure liveness probe.

/ready

The endpoint responds:

  • 200 status code if the server is ready.
{ "status": "ready" }
  • 503 status code with an empty response if the server is not ready (started, shutting down, etc).

Example

See: EXAMPLE.md

API Doc

See: API.md

Integration with Docker

See: DOCKER.md

Integration with Kubernetes

See: KUBERNETES.md

Thanks

Terminus

Lightship

Stoppable

Bret Fisher for his great articles and videos

IBM documentation

Node HTTP documentation

Cloud Health

Cloud Health Connect

Sponsors

JetBrains Logo

Donate

Donate

If you like my job, don't hesitate to contribute to this project! ❤️

Keywords

FAQs

Package last updated on 27 Aug 2024

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