feat: add catch-all API route with handler imports
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import { dispatch } from '@/lib/router';
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
|
||||
// Import all handlers to register their routes
|
||||
import '@/lib/handlers/player';
|
||||
import '@/lib/handlers/battlepass';
|
||||
import '@/lib/handlers/game';
|
||||
import '@/lib/handlers/payments';
|
||||
import '@/lib/handlers/leaderboard';
|
||||
import '@/lib/handlers/cards';
|
||||
import '@/lib/handlers/equipment';
|
||||
import '@/lib/handlers/arsenal';
|
||||
import '@/lib/handlers/marketplace';
|
||||
import '@/lib/handlers/contracts';
|
||||
|
||||
export const dynamic = 'force-dynamic';
|
||||
|
||||
export async function GET(request: NextRequest, { params }: { params: { path: string[] } }) {
|
||||
return dispatch(request, params.path, 'GET');
|
||||
}
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: { path: string[] } }) {
|
||||
return dispatch(request, params.path, 'POST');
|
||||
}
|
||||
|
||||
export async function PUT(request: NextRequest, { params }: { params: { path: string[] } }) {
|
||||
return dispatch(request, params.path, 'PUT');
|
||||
}
|
||||
Reference in New Issue
Block a user