34 lines
737 B
TypeScript
34 lines
737 B
TypeScript
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,
|
|
},
|
|
});
|
|
}
|