2025-03-22 01:36:27 -04:00
|
|
|
import { LoaderFunctionArgs } from 'react-router';
|
|
|
|
|
import type { LoadContext } from '~/server';
|
2024-11-27 11:23:42 -05:00
|
|
|
|
2025-03-22 01:36:27 -04:00
|
|
|
export async function loader({ context }: LoaderFunctionArgs<LoadContext>) {
|
|
|
|
|
const healthy = await context.client.healthcheck();
|
2025-01-10 10:46:50 +05:30
|
|
|
return new Response(JSON.stringify({ status: healthy ? 'OK' : 'ERROR' }), {
|
|
|
|
|
status: healthy ? 200 : 500,
|
|
|
|
|
headers: {
|
|
|
|
|
'Content-Type': 'application/json',
|
|
|
|
|
},
|
|
|
|
|
});
|
2024-11-27 11:23:42 -05:00
|
|
|
}
|