@nasontech/nuxt-healthcheck
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

Nuxt Healthcheck

npm version npm downloads License Nuxt Healthcheck Nuxt logger for doing amazing things.

Features

Simply application healthcheck endpoints.

Quick Setup

Install the module to your Nuxt application with one command:

npx nuxi module add @nasontech/nuxt-healthcheck

That's it! You can now use defineHealthcheck in your Nuxt app ✨

Files placed in server/healthchecks will be registered automatically using the filename as the healthcheck name.

Example server/healthchecks/database.ts

export default defineHealthcheck((_event) => {
	const data = {
		usedConnections: 0,
		maxConnections: 10,
		unusedConnections: 5,
	}

	const isHealthy = data.usedConnections < data.maxConnections

	return {
		data,
		isHealthy,
	}
})

Querying /readyz?verbose will return

{
	"database": {
		"isHealthy": true,
		"data": {
			"usedConnections": 0,
			"maxConnections": 10,
			"unusedConnections": 5
		}
	}
}

Contribution

Local development
# Install dependencies
npm install

# Generate type stubs
npm run dev:prepare

# Develop with the playground
npm run dev

# Build the playground
npm run dev:build

# Run ESLint
npm run lint

# Run Vitest
npm run test
npm run test:watch

# Release new version
npm run release

Readme

Keywords

none

Package Sidebar

Install

npm i @nasontech/nuxt-healthcheck

Weekly Downloads

1

Version

0.0.2

License

MIT

Unpacked Size

12.4 kB

Total Files

22

Last publish

Collaborators

  • bnason