{JSON.stringify(error, null, 2)}; - } else if (error instanceof Error) { - return
{JSON.stringify(error, null, 2)}; - } else { - return
Unknown error
; - } -} - -// export default function Index() { -// returnIndex
; -// } diff --git a/src/app/routes/api/ping.ts b/src/app/routes/api/ping.ts deleted file mode 100644 index ca8e9c57..00000000 --- a/src/app/routes/api/ping.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { LoaderArgs, json } from '@remix-run/node'; -import { prisma } from '~/db.server'; - -export async function loader({ context, request }: LoaderArgs) { - try { - // test database connection - await prisma.user.count(); - - return json({ pong: true }, { status: 200 }); - } catch (e) { - return json({ pong: false }, { status: 500 }); - } -} diff --git a/src/app/routes/index.tsx b/src/app/routes/index.tsx deleted file mode 100644 index e50d7d0f..00000000 --- a/src/app/routes/index.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { LoaderArgs, json } from '@remix-run/node'; -import { useLoaderData } from '@remix-run/react'; -import { prisma } from '~/db.server'; - -export async function loader({}: LoaderArgs) { - let zipline = await prisma.zipline.findFirst(); - if (!zipline) { - zipline = await prisma.zipline.create({ data: {} }); - } - - return json({ zipline }); -} - -export default function Index() { - const { zipline } = useLoaderData{JSON.stringify(zipline, null, 2)}-