17 lines
413 B
TypeScript
17 lines
413 B
TypeScript
import { getStoreSnapshot } from '@/lib/server/store';
|
|
|
|
export async function GET() {
|
|
const snapshot = await getStoreSnapshot();
|
|
const queue = snapshot.tasks.reduce<Record<string, number>>((acc, task) => {
|
|
acc[task.status] = (acc[task.status] ?? 0) + 1;
|
|
return acc;
|
|
}, {});
|
|
|
|
return Response.json({
|
|
status: 'ok',
|
|
version: '3.0.0',
|
|
timestamp: new Date().toISOString(),
|
|
queue
|
|
});
|
|
}
|