gquittet/graceful-server
关于
Tiny (~5k), KISS, dependency-free Node.JS library to make your API more graceful
系统与基础设施实测星标增长
- 24小时
- -1
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文🚀 Graceful Server 🐢
Tiny (~5k), KISS, dependency-free Node.js library to make your Rest API graceful.
- Features
- Requirements
- Installation
- Endpoint
- Example
- API Doc
- Integration with Docker
- Integration with Kubernetes
- Thanks
- Powered by
- Donate
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:
200status code with the uptime of the server in second.
{ "uptime": 42 }
Used to configure liveness probe.
/ready
The endpoint responds:
200status code if the server is ready.
{ "status": "ready" }
503status 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
★ Bret Fisher for his great articles and videos
Powered by
Donate
If you like my job, don't hesitate to contribute to this project! ❤️
探索相关项目
加载中…