refactor: 精簡 /health 回應欄位 #15

Merged
a620906209 merged 1 commits from feature/health-endpoint into master 2026-05-28 18:05:30 +00:00
Showing only changes of commit 8d41f473e4 - Show all commits
+3 -7
View File
@@ -25,13 +25,9 @@ Route::get('/health', function () {
$healthy = $checks['db'] && $checks['redis'] && $checks['cache']; $healthy = $checks['db'] && $checks['redis'] && $checks['cache'];
return response()->json([ return response()->json([
'status' => $healthy ? 'ok' : 'degraded', 'status' => $healthy ? 'ok' : 'degraded',
'timestamp' => now()->toIso8601String(), 'timestamp' => now()->toIso8601String(),
'environment' => app()->environment(), 'checks' => $checks,
'php_version' => PHP_VERSION,
'laravel' => app()->version(),
'memory_mb' => round(memory_get_usage(true) / 1024 / 1024, 2),
'checks' => $checks,
], $healthy ? 200 : 503); ], $healthy ? 200 : 503);
}); });