Files
ssvc-rimsting-vote/src/app/(full)/api/public-stats/route.ts
T
2025-03-02 21:43:19 +00:00

18 lines
468 B
TypeScript

import { getSurveyStats } from '@/lib/survey';
import { NextResponse } from 'next/server';
export async function GET() {
try {
// Get survey statistics without requiring authentication
const stats = getSurveyStats();
return NextResponse.json({ stats });
} catch (error) {
console.error('Error getting public stats:', error);
return NextResponse.json(
{ error: 'Failed to get survey statistics' },
{ status: 500 }
);
}
}