Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
/ koa-ok Public archive

Koa middleware for surfacing a health check ping route

License

Notifications You must be signed in to change notification settings

digivizer/koa-ok

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

koa-ok

NPM version build status

Koa middleware providing a health check ping route that always returns a 200 OK response.

Install

npm install --save koa-ok

API

ok(String path)

Returns an async function that plugs into a Koa middleware stack.

The path argument accepts a String that defines the URL path to match on. This must include a leading / character (eg: /ping, /_health).

Any requests matching the path will return a text/plain response with the body set to OK. This will also halt further processing of the middleware chain.

Usage

const koa = require('koa')
const ok = require('koa-ok')

const app = new koa()

app.use(ok('/ping'))

app.listen(3000)

License

Copyright 2018 Digivizer Pty Ltd.

This project is open source under the terms of the ISC license. See the LICENSE file included with this software distribution for more information.

About

Koa middleware for surfacing a health check ping route

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published