mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-22 03:07:04 +02:00
feat: removed non-proxy apis
This commit is contained in:
1 parent
925ac96264
commit
6ff2a23ff7
11 files changed
+54
-65
No files matched your search
@@ -1,11 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import listPlayers from '../../../../core/blitz/listPlayers';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const search = request.nextUrl.searchParams.get('search');
|
||||
const limitParam = request.nextUrl.searchParams.get('limit');
|
||||
const limit = limitParam ? parseInt(limitParam) : undefined;
|
||||
const players = search ? await listPlayers(search, limit) : [];
|
||||
|
||||
return NextResponse.json(players);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
import { NextRequest, NextResponse } from 'next/server';
|
||||
import { Region } from '../../../../../constants/regions';
|
||||
import getTankStats from '../../../../../core/blitz/getTankStats';
|
||||
import { NormalizedTankStats } from '../../../../../types/tanksStats';
|
||||
|
||||
export async function GET(request: NextRequest) {
|
||||
const region = request.nextUrl.searchParams.get('region') as Region;
|
||||
const id = parseInt(request.nextUrl.searchParams.get('id')!);
|
||||
const tankStats = await getTankStats(region, id);
|
||||
const normalized = tankStats.reduce<NormalizedTankStats>(
|
||||
(accumulator, tank) => ({ ...accumulator, [tank.tank_id]: tank }),
|
||||
{},
|
||||
);
|
||||
|
||||
return NextResponse.json(normalized);
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { tankopedia } from '../../../core/blitz/tankopedia';
|
||||
|
||||
export async function GET() {
|
||||
return NextResponse.json(await tankopedia);
|
||||
}
|
||||
Reference in new issue
Block a user