a new start

This commit is contained in:
valknarness
2025-10-25 16:09:02 +02:00
commit b63592f153
94 changed files with 23058 additions and 0 deletions

24
app/api/stats/route.ts Normal file
View File

@@ -0,0 +1,24 @@
import { NextResponse } from 'next/server'
import { getStats, getLanguages, getCategories, getTrendingRepositories } from '@/lib/db'
export async function GET() {
try {
const stats = getStats()
const languages = getLanguages()
const categories = getCategories()
const trending = getTrendingRepositories(10)
return NextResponse.json({
stats,
languages,
categories,
trending
})
} catch (error) {
console.error('Stats API error:', error)
return NextResponse.json(
{ error: 'Internal server error' },
{ status: 500 }
)
}
}