feat(ux-37): add /api/version deployment metadata endpoint and CI verification gate
Deploy Canina / deploy (push) Successful in 2m9s
Deploy Canina / deploy (push) Successful in 2m9s
This commit is contained in:
1 parent
961bb383db
commit
87bf867513
2 files changed
+52
No files matched your search
@@ -0,0 +1,33 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET() {
|
||||
const commitSha =
|
||||
process.env.NEXT_PUBLIC_GIT_COMMIT ||
|
||||
process.env.GIT_COMMIT_SHA ||
|
||||
process.env.COMMIT_SHA ||
|
||||
'local-build';
|
||||
|
||||
const buildTime =
|
||||
process.env.BUILD_TIMESTAMP ||
|
||||
process.env.NEXT_PUBLIC_BUILD_TIME ||
|
||||
new Date().toISOString();
|
||||
|
||||
const environment = process.env.NODE_ENV || 'production';
|
||||
const service = 'frontend';
|
||||
|
||||
return NextResponse.json({
|
||||
status: 'ok',
|
||||
service,
|
||||
commitSha,
|
||||
buildTime,
|
||||
environment,
|
||||
}, {
|
||||
status: 200,
|
||||
headers: {
|
||||
'Cache-Control': 'no-store, no-cache, must-revalidate',
|
||||
'X-Commit-Sha': commitSha,
|
||||
},
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user