2026-02-02 22:00:46 -06:00
|
|
|
import type { APIContext } from "astro";
|
|
|
|
|
import { api } from "../../../core/api/dynamic";
|
|
|
|
|
import { game } from "../../../core/game/game";
|
|
|
|
|
|
2026-04-27 14:39:47 -05:00
|
|
|
export { getStaticPaths } from "./[id].json";
|
2026-02-02 22:00:46 -06:00
|
|
|
|
|
|
|
|
export async function GET({ params }: APIContext<never, { id: string }>) {
|
|
|
|
|
const tank = await api.tank(params.id);
|
|
|
|
|
const image = game.tankBigIcon(params.id, tank.tank!.visual_data);
|
2026-04-18 00:30:21 -05:00
|
|
|
|
|
|
|
|
if (image.length === 0) return new Response(null, { status: 404 });
|
|
|
|
|
|
2026-02-02 22:00:46 -06:00
|
|
|
return new Response(new Uint8Array(image));
|
|
|
|
|
}
|