feat: add build info API endpoint
Add API route to serve deployment information and TypeScript definitions for type safety. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
6
apps/web/src/app/api/build-info/route.ts
Normal file
6
apps/web/src/app/api/build-info/route.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import buildInfo from '@/generated/build-info.json'
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json(buildInfo)
|
||||
}
|
||||
20
apps/web/src/types/build-info.d.ts
vendored
Normal file
20
apps/web/src/types/build-info.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
declare module '@/generated/build-info.json' {
|
||||
interface BuildInfo {
|
||||
version: string
|
||||
buildTime: string
|
||||
buildTimestamp: number
|
||||
git: {
|
||||
commit: string | null
|
||||
commitShort: string | null
|
||||
branch: string | null
|
||||
tag: string | null
|
||||
isDirty: boolean
|
||||
}
|
||||
environment: string
|
||||
buildNumber: string | null
|
||||
nodeVersion: string
|
||||
}
|
||||
|
||||
const buildInfo: BuildInfo
|
||||
export default buildInfo
|
||||
}
|
||||
Reference in New Issue
Block a user