Skip to content

Commit

Permalink
🚧 Rewrite
Browse files Browse the repository at this point in the history
  • Loading branch information
smoliji committed May 4, 2024
1 parent cdeed9d commit 1b97f0e
Show file tree
Hide file tree
Showing 22 changed files with 2,033 additions and 594 deletions.
127 changes: 0 additions & 127 deletions .circleci/config.yml

This file was deleted.

26 changes: 26 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js CI

on:
push:
branches:
- '**'

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x, 18.x, 20.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm install
- run: npm run build
- run: npm test
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
node_modules
.vscode
dist
dist
3 changes: 0 additions & 3 deletions .npmignore

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore artifacts:
dist
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true

}
15 changes: 15 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

## [Unreleased] - 2024-05-03

### Added
- Changelog
- Tests
- ExpressJS demo
- Basic healthz functionality
- HTML and JSON preview
- Build & minification with esbuild
- GitHub actions

### Removed
- Everything
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 Jiri Smolik

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
45 changes: 45 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# node-healthz

The "health-checkup" npm package simplifies the process of implementing health checks in Node.js applications, allowing you to ensure the reliability and availability of your system components effortlessly.

```ts
import { check } from 'node-healthz'
check({
checks: [
{
id: 'PostgreSQL',
required: true,
fn: async () => /* ... */,
},
{
id: 'Redis',
fn: async () => /* ... */,
},
],
})
```
```
curl http://localhost:46461/healthz --verbose | jq
< HTTP/1.1 200 OK
{
"status": "OK",
"checks": [
{
"id": "PostgreSQL",
"required": "true",
"t": "1,003ms",
"output": "<masked>"
},
{
"id": "Redis",
"required": "false",
"t": "11ms",
"output": "<masked>"
}
]
}
```

### Guides

- [How to use with ExpressJS](./demo/express.ts)
105 changes: 0 additions & 105 deletions README.md

This file was deleted.

Loading

0 comments on commit 1b97f0e

Please sign in to comment.