node package manager



Server library

addHealthItem(name, interval, func)

Add an item to be monitored for health

Param Type Description
name String Cannot already exist
interval Number Must be greater than or equal to zero
func function () => Promise

addShutdownItem(name, priority, func)

Add a function to be run before the server completes a shutdown

Param Type Description
name String !_.isDefined(shutdown[name])
priority Number >= 0 && <= 100
func function () => Promise

setHealthItem(name, isHealthy)

Sets the health of a health item

Param Type Description
name String Must exist
isHealthy Boolean


Run the shutdown procedure

Param Type Description
[err] Error Error that caused the shutdown

createSocket(args) => Object

Creates a web socket server

Param Type Default
args Object
[args.log] Boolean true
[args.msgpack] Boolean false
args.port Number

createWeb(args) => Object

Creates a web server

Param Type Default Description
args Object
[args.authByKey] Boolean | String false false disables
[args.cookies] Boolean false
[args.cors] Boolean Defaults to args.isApi
[args.etag] Boolean Defaults to !args.isApi
[args.gzip] Boolean true
[args.http] Number
[args.https] Number
[args.isApi] Boolean true
[args.keepAlive] Boolean true
[args.limit] String 1mb
[args.log] Boolean true
[args.middleware] Array.<function()>
[args.noCache] Boolean Defaults to args.isApi
[args.noFrame] Boolean false
[args.routes] String dist/routes false disables
[args.static] Boolean | String dist/static false disables
[args.throttle] Boolean | Object false false disables
[args.throttle.max] Number 60
[args.throttle.ttl] Number 60000
[args.throttle.whitelist] Array.<String>
[args.timeout] Number 30000
[args.tokenName] Boolean | String token
[args.upstream] Boolean false
[args.views] String views