diff --git a/package.json b/package.json index 9a6a7097..df78f48b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "osit-aether-app-svelte", - "version": "3.00.65", + "version": "3.00.66", "description": "One Sky IT's Aether App created with Svelte, SvelteKit, Tailwind CSS, Lucide, Font Awesome, and Skeleton UI. -Scott Idem", "homepage": "https://oneskyit.com/", "private": true, diff --git a/src/app.d.ts b/src/app.d.ts index 9b354164..b8d467b1 100644 --- a/src/app.d.ts +++ b/src/app.d.ts @@ -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 {} diff --git a/src/routes/health/+server.ts b/src/routes/health/+server.ts index d98cf10d..451ce626 100644 --- a/src/routes/health/+server.ts +++ b/src/routes/health/+server.ts @@ -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' }, { diff --git a/vite.config.ts b/vite.config.ts index 8034b963..52d8c4af 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,9 +1,16 @@ import { defineConfig } from 'vite'; import { sveltekit } from '@sveltejs/kit/vite'; import tailwindcss from '@tailwindcss/vite'; +import { readFileSync } from 'fs'; + +const pkg = JSON.parse(readFileSync('./package.json', 'utf-8')); export default defineConfig({ cacheDir: 'node_modules/.vite', + define: { + __BUILD_TIME__: JSON.stringify(new Date().toISOString()), + __BUILD_VERSION__: JSON.stringify(pkg.version) + }, plugins: [ tailwindcss(), sveltekit() // <-- Must come after Tailwind