aboutsummaryrefslogtreecommitdiffstats
path: root/backend/src/routes
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 23:55:33 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 23:55:33 -0700
commit722df5105c098f404e09e884a817acf92d939648 (patch)
tree2644c1921a66279a497fcf69fd778925b37993fb /backend/src/routes
parenteda5691cfcb3be0bb6ccf1b2ad4fa92801ad86c4 (diff)
add route to list supported games
Diffstat (limited to 'backend/src/routes')
-rw-r--r--backend/src/routes/gameRoutes.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/backend/src/routes/gameRoutes.ts b/backend/src/routes/gameRoutes.ts
new file mode 100644
index 0000000..26e7171
--- /dev/null
+++ b/backend/src/routes/gameRoutes.ts
@@ -0,0 +1,19 @@
+import express from 'express';
+import { prisma } from '../config/db';
+
+export const handleGetSupportedGames = async (req: express.Request, res: express.Response) => {
+ try {
+ const supportedGames = await prisma.game.findMany({
+ select: {
+ internalName: true,
+ formattedName: true,
+ description: true
+ }
+ });
+ res.status(200).json(supportedGames);
+
+ } catch (error) {
+ console.error('Supported Games endpoint error:', error);
+ res.status(500).json({ error: 'Internal server error. Unable to fetch supported games' });
+ }
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage