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,16 @@
import type { RequestHandler } from "@sveltejs/kit";
import { listResponse, singleResponse } from "$lib/server/responseBodies";
import { createNewListing } from "$lib/server/modifyListing";
import { Game } from "$lib/server/Game";
import { games } from "$lib/server/cache";
export const GET: RequestHandler = (): Response => {
return listResponse(games);
};
export const POST: RequestHandler = (): Response => {
const newListing = createNewListing(new Game());
games.push(newListing);
return singleResponse(newListing.id);
};