* 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>
14 lines
349 B
JavaScript
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}`)
|
|
}
|