From d42d5ae61505a5cfc87f5256cb3f09f18a7cff2f Mon Sep 17 00:00:00 2001 From: Oscar Beaumont Date: Mon, 28 Oct 2024 14:55:03 +0800 Subject: [PATCH] a --- apps/web/src/app/api/c.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 apps/web/src/app/api/c.ts diff --git a/apps/web/src/app/api/c.ts b/apps/web/src/app/api/c.ts new file mode 100644 index 00000000..2ad4cca2 --- /dev/null +++ b/apps/web/src/app/api/c.ts @@ -0,0 +1,15 @@ +// TODO: Remove this file + +import type { APIEvent } from "@solidjs/start/server"; +import { accounts, db } from "~/db"; + +export const GET = async ({ request, nativeEvent }: APIEvent) => { + try { + const users = await db.select().from(accounts); + + return new Response(`ok ${users.length}`); + } catch (err) { + console.error(err); + return new Response("error", { status: 500 }); + } +};