mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-14 01:54:40 -04:00
Add build-id/route.ts
This commit is contained in:
8
web/pages/api/build-id/route.ts
Normal file
8
web/pages/api/build-id/route.ts
Normal file
@@ -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 });
|
||||
}
|
||||
Reference in New Issue
Block a user