From 8f760081a5fbc7df34c71a6c715b16c0a128f347 Mon Sep 17 00:00:00 2001 From: MartinBraquet Date: Mon, 3 Nov 2025 15:25:11 +0100 Subject: [PATCH] Add build-id/route.ts --- web/pages/api/build-id/route.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 web/pages/api/build-id/route.ts diff --git a/web/pages/api/build-id/route.ts b/web/pages/api/build-id/route.ts new file mode 100644 index 00000000..85406627 --- /dev/null +++ b/web/pages/api/build-id/route.ts @@ -0,0 +1,8 @@ +import path from 'path'; +import fs from 'fs'; + +export default function handler(req: any, res: any) { + const buildId = fs.readFileSync(path.join(process.cwd(), '.next', 'BUILD_ID'), 'utf8').trim(); + res.setHeader('Cache-Control', 's-maxage=31536000, stale-while-revalidate'); + res.status(200).json({ buildId }); +} \ No newline at end of file