Skip to content
프로젝트

소개

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

시스템 및 인프라

이 수치를 측정하는 방법

측정된 스타 증가

in 24h
-1
in 7 days
0
in 15 days
0
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

🚀 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 to 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 avoids boilerplate codes.

✔ Kubernetes compliant.

✔ Dependency-free.

✔ KISS code base.

✔ Custom health check callbacks for advanced liveness/readiness logic.

✔ Multiple instances support (no more singleton).

Requirements

✔ NodeJS >= 20.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 set up 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

Powered by

JetBrains logo.

Donate

Donate

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

관련 프로젝트 살펴보기

불러오는 중…