asclepius-standard
Advanced tools
Comparing version 1.0.0 to 1.0.1
15
index.js
const asclepius = require('asclepius'); | ||
const nullLogger = require('null-logger'); | ||
const sequelizeHealthcheck = (sequelize) => asclepius.healthcheck( | ||
const sequelizeHealthcheck = (sequelize, logger = nullLogger) => asclepius.healthcheck( | ||
'psql', | ||
@@ -16,3 +17,3 @@ () => | ||
const redisHealthcheck = (redis) => asclepius.healthcheck( | ||
const redisHealthcheck = (redis, logger = nullLogger) => asclepius.healthcheck( | ||
'redis', | ||
@@ -32,3 +33,3 @@ () => | ||
const elasticsearchHealthcheck = (elasticsearch) => asclepius.healthcheck( | ||
const elasticsearchHealthcheck = (elasticsearch, logger = nullLogger) => asclepius.healthcheck( | ||
'elasticsearch', | ||
@@ -53,10 +54,10 @@ () => | ||
module.exports = { | ||
setup: ({ sequelize = null, redis = null, elasticsearch = null } = {}) => { | ||
setup: ({ sequelize = null, redis = null, elasticsearch = null, logger = nullLogger } = {}) => { | ||
const healthchecks = [processHealthcheck]; | ||
if (sequelize) healthchecks.push(sequelizeHealthcheck(sequelize)); | ||
if (elasticsearch) healthchecks.push(elasticsearchHealthcheck(elasticsearch)); | ||
if (redis) healthchecks.push(redisHealthcheck(redis)); | ||
if (sequelize) healthchecks.push(sequelizeHealthcheck(sequelize, logger)); | ||
if (elasticsearch) healthchecks.push(elasticsearchHealthcheck(elasticsearch, logger)); | ||
if (redis) healthchecks.push(redisHealthcheck(redis, logger)); | ||
return asclepius.makeRoute(healthchecks); | ||
} | ||
}; |
{ | ||
"name": "asclepius-standard", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Asclepius Standard Configuration", | ||
@@ -13,4 +13,5 @@ "repository": "git@github.com:ordermentum/asclepius-standard.git", | ||
"dependencies": { | ||
"asclepius": "^0.0.2" | ||
"asclepius": "^0.0.2", | ||
"null-logger": "^1.0.0" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2501
54
2
+ Addednull-logger@^1.0.0
+ Addednull-logger@1.0.0(transitive)