bring server files into project.

This commit is contained in:
2025-01-21 11:50:01 -08:00
parent 58d100b5d3
commit 8700c431cf
32 changed files with 2200 additions and 9 deletions

View File

@ -0,0 +1,14 @@
import { games } from "$lib/server/cache";
import { notFoundResponse, singleResponse } from "$lib/server/responseBodies";
import type { RequestHandler } from "@sveltejs/kit";
export const GET: RequestHandler = ({ params }): Response => {
const id = params["gameid"];
const game = games.find(({ id: gid }) => id === gid);
if (!game) {
return notFoundResponse();
}
return singleResponse(game);
};