Expose health diagnostics at root

This commit is contained in:
2026-05-21 13:02:25 -05:00
parent 961662a10e
commit c477643781
3 changed files with 49 additions and 10 deletions

View File

@@ -21,6 +21,10 @@ Route::prefix('v1')->middleware(['jwt.auth'])->group(function () {
Route::get('/games/most-played', [GameController::class, 'mostPlayed']);
});
Route::get('/health', function () {
return response()->json(['status' => 'ok']);
});
Route::get('/health-check-key', function () {
$rawPublicKey = (string) config('jwt.public_key');
$formattedPublicKey = str_replace('\\n', "\n", $rawPublicKey);

View File

@@ -1 +1,20 @@
<?php
use Illuminate\Support\Facades\Route;
Route::get('/health', function () {
return response()->json(['status' => 'ok']);
});
Route::get('/health-check-key', function () {
$rawPublicKey = (string) config('jwt.public_key');
$formattedPublicKey = str_replace('\\n', "\n", $rawPublicKey);
$publicKeyResource = openssl_pkey_get_public($formattedPublicKey);
return response()->json([
'raw_key_empty' => $rawPublicKey === '',
'key_length' => strlen($formattedPublicKey),
'openssl_accepted' => $publicKeyResource !== false,
'openssl_error' => openssl_error_string(),
]);
});