Neah/app/api/redis/status/route.ts
2025-04-27 17:01:48 +02:00

24 lines
603 B
TypeScript

import { NextResponse } from 'next/server';
import { getRedisStatus } from '@/lib/redis';
/**
* API route to check Redis connection status
* Used for monitoring and debugging
*/
export async function GET() {
try {
const status = await getRedisStatus();
return NextResponse.json({
ready: status.status === 'connected',
status: status.status,
ping: status.ping,
error: status.error
});
} catch (error) {
return NextResponse.json({
ready: false,
error: error instanceof Error ? error.message : 'Unknown error'
}, { status: 500 });
}
}