Skip to content

Commit

Permalink
add sha to status endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
elrayle committed Jan 24, 2024
1 parent a2a2abd commit 4334f74
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 4334f74

Please sign in to comment.