diff --git a/apps/webapp/app/routes/healthcheck.tsx b/apps/webapp/app/routes/healthcheck.tsx index e1cfd73fb..05c00945a 100644 --- a/apps/webapp/app/routes/healthcheck.tsx +++ b/apps/webapp/app/routes/healthcheck.tsx @@ -1,24 +1,9 @@ -// learn more: https://fly.io/docs/reference/configuration/#services-http_checks import { prisma } from "~/db.server"; import type { LoaderFunction } from "@remix-run/node"; export const loader: LoaderFunction = async ({ request }) => { - const host = request.headers.get("X-Forwarded-Host") ?? request.headers.get("host"); - try { - const url = new URL("/", `http://${host}`); - - if (request.headers.get("x-forwarded-proto") === "https") { - url.protocol = "https:"; - } - // if we can connect to the database and make a simple query - // and make a HEAD request to ourselves, then we're good. - await Promise.all([ - prisma.user.count(), - fetch(url.href, { method: "HEAD" }).then((r) => { - if (!r.ok) return Promise.reject(r); - }), - ]); + await prisma.user.count(); return new Response("OK"); } catch (error: unknown) { console.log("healthcheck ❌", { error });