1
0
mirror of synced 2025-12-21 02:46:50 -05:00
Files
docs/middleware/build-info.js
Peter Bengtsson 36da8f2c73 expose build SHA (#27542)
* expose build SHA

* dbg

* dbg

* dbg

* sub

* oops

* oops

* try this

* debugging

* debugging

* debugging

* debugging

* debugging

* without quotes

* typo

* typo

* singular

* mention in Dockerfile

* plural

* does this work

* does this work

* tidying up

* no cache

* Update middleware/index.js

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>

Co-authored-by: Kevin Heis <heiskr@users.noreply.github.com>
2022-05-11 19:14:30 +00:00

14 lines
349 B
JavaScript

import { cacheControlFactory } from './cache-control.js'
const BUILD_SHA = process.env.BUILD_SHA
const noCacheControl = cacheControlFactory(0)
export default function buildInfo(req, res, next) {
res.type('text/plain')
noCacheControl(res)
if (!BUILD_SHA) {
return res.status(404).send('Not known')
}
return res.send(`${BUILD_SHA}`)
}