diff --git a/health-check/index.js b/health-check/index.js index 91fc9ca..f444efd 100644 --- a/health-check/index.js +++ b/health-check/index.js @@ -16,7 +16,7 @@ const httpService = require('./services/httpService') * @param {string} [currentServiceName=''] - Optional. Name of the current service to avoid self-check. * @returns {Promise} - A formatted response with health check results. */ -async function healthCheckHandler(config, basicCheck = false, currentServiceName = '') { +async function healthCheckHandler(config, basicCheck = false, currentServiceName = '', serviceVersion) { validateHealthConfig(config) const checks = [] @@ -102,7 +102,7 @@ async function healthCheckHandler(config, basicCheck = false, currentServiceName checks, } - return formatResponse(result) + return formatResponse(result,serviceVersion) } /** @@ -193,10 +193,10 @@ function validateHealthConfig(config) { * @param {Object} result - The object containing service name, version, healthy status, and checks. * @returns {Object} - The formatted response object. */ -function formatResponse(result) { +function formatResponse(result,serviceVersion) { return { id: 'service.health.api', - ver: '1.0', + version: serviceVersion, ts: new Date(), params: { resmsgid: uuidv1(), diff --git a/health-check/package.json b/health-check/package.json index 338b5e0..7283954 100644 --- a/health-check/package.json +++ b/health-check/package.json @@ -1,6 +1,6 @@ { "name": "elevate-services-health-check", - "version": "0.0.7", + "version": "0.0.8", "description": "Package that can be used for service health check", "main": "index.js", "scripts": {