From 4334f749aebbf03ad958c428a5daaf29d2fb3455 Mon Sep 17 00:00:00 2001 From: "E. Lynette Rayle" Date: Tue, 16 Jan 2024 16:30:13 -0500 Subject: [PATCH] add sha to status endpoint --- routes/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/routes/index.js b/routes/index.js index a9a01f38f..1146de78e 100644 --- a/routes/index.js +++ b/routes/index.js @@ -4,7 +4,11 @@ const express = require('express') const router = express.Router() router.get('/', function(req, res) { - res.status(200).send({ status: 'OK' }) + const sha = require('child_process') + .execSync('git rev-parse HEAD') + .toString().trim() + const msg = `{ "status": "OK", "sha": "${sha}" }` + res.status(200).send(msg) }) module.exports = router