UNPKG

patternplate-server

Version:

Programmatically serve atomic patterns via a REST API

12 lines (10 loc) 291 B
export default function healthRouteFactory (application, configuration) { return function * healthRoute () { let health = application.cache ? application.cache.ready : true; this.status = health ? 200 : 503; this.body = { 'name': application.name, 'healthy': health }; }; }