import { existsSync, readFileSync } from 'fs'; import { execSync } from 'child_process'; export default defineEventHandler(() => { const path = process.cwd() + '/version.json'; if (existsSync(path)) { return JSON.parse(readFileSync(path, 'utf-8')); } return { buildTime: new Date().toISOString(), gitCommit: execSync('git rev-parse --short HEAD').toString().trim(), generated: true, }; });