diff --git a/functions/api/gme/list.ts b/functions/api/gme/list.ts new file mode 100644 index 0000000..84851f9 --- /dev/null +++ b/functions/api/gme/list.ts @@ -0,0 +1,16 @@ +export async function onRequestGet(context: RequestContext) { + const list = await context.env.DATA.list({ prefix: "gamemod_" }); + const entries = []; + + for (const key of list.keys) + entries.push({ + metadata: key.metadata, + user: key.name.replace("gamemod_", ""), + }); + + return new Response(JSON.stringify(entries), { + headers: { + "content-type": "application/json", + }, + }); +}