mirror of
https://github.com/yusufipk/RepoHub.git
synced 2026-09-11 10:36:07 +00:00
- Added undici dependency and implemented three package fetcher variants (simple text parsing, v2 with better error handling, and official repository sync) - Integrated real API calls in PlatformSelector and PackageBrowser components with fallback to mock data - Extended sync API route to support multiple data sources (debian-simple, ubuntu-simple, debian-official-v2, etc.) with platform initialization
19 lines
511 B
TypeScript
19 lines
511 B
TypeScript
import { NextResponse } from 'next/server'
|
|
import { PlatformInitializer } from '@/services/platformInitializer'
|
|
|
|
export async function POST() {
|
|
try {
|
|
await PlatformInitializer.initializePlatforms()
|
|
return NextResponse.json({
|
|
success: true,
|
|
message: 'Platforms initialized successfully'
|
|
})
|
|
} catch (error) {
|
|
console.error('Error initializing platforms:', error)
|
|
return NextResponse.json(
|
|
{ error: 'Failed to initialize platforms' },
|
|
{ status: 500 }
|
|
)
|
|
}
|
|
}
|