2.1.2 • Published 1 year ago

hafas-client-health-check v2.1.2

Weekly downloads
1
License
ISC
Repository
github
Last release
1 year ago

hafas-client-health-check

A heuristic to check if a hafas-client@5/hafas-client@6 instance and the underlying HAFAS endpoint work. It will query departures at a well-known station for the coming Monday 8am.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installation

npm install hafas-client-health-check

Usage

const createHafasClient = require('hafas-client')
const dbProfile = require('hafas-client/p/db')
const createHealthCheck = require('hafas-client-health-check')

const hafasClient = createHafasClient(dbProfile, 'my-awesome-program')
const berlinHbf = '8011160'
const checkIfHealthy = createHealthCheck(hafasClient, berlinHbf)

checkIfHealthy()
.then((isHealthy) => {
	if (isHealthy) console.error('hafas-client instance is healthy.')
	else console.error('hafas-client instance is not healthy!')
})
.catch((err) => { // something exceptional happend
	console.error(err)
	process.exitCode = 1
})

Contributing

If you have a question or need support using hafas-client-health-check, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.

2.1.2

1 year ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.1.0

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago