feat(build): inject build time and version into health endpoint

Vite define injects __BUILD_TIME__ and __BUILD_VERSION__ at build time
so /health returns the exact timestamp and package version of the running
build — useful for verifying deploys without guessing what changed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-06-22 15:13:04 -04:00
parent 0cd008af73
commit 677ec9d918
4 changed files with 13 additions and 6 deletions

3
src/app.d.ts vendored
View File

@@ -10,6 +10,9 @@ declare namespace App {
// interface Platform {}
}
declare const __BUILD_TIME__: string;
declare const __BUILD_VERSION__: string;
declare global {
namespace App {
interface Platform {}

View File

@@ -1,16 +1,13 @@
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
/**
* Health Check Endpoint
* Used by Docker and Nginx to verify the service is running.
*/
export const GET: RequestHandler = async () => {
return json(
{
status: 'healthy',
timestamp: new Date().toISOString(),
service: 'aether-app-sveltekit',
version: __BUILD_VERSION__,
build_time: __BUILD_TIME__,
node_env: process.env.NODE_ENV || 'development'
},
{