Skip to content
Discussion options

You must be logged in to vote

Actually, the final solution that I used was to modify only the /healthcheck route.
Leaving it here for posterity:

// learn more: https://fly.io/docs/reference/configuration/#services-http_checks
import { type LoaderArgs } from "@remix-run/node";
import { prisma } from "~/db.server";

export async function loader({ request }: LoaderArgs) {
  const host =
    request.headers.get("X-Forwarded-Host") ?? request.headers.get("host");
  try {
    const url = new URL("/", `http://${host}`);
    // 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.toString(), { h…

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@lukejagodzinski
Comment options

@lukejagodzinski
Comment options

@lukejagodzinski
Comment options

@lukejagodzinski
Comment options

Answer selected by lukejagodzinski
@kiliman
Comment options

@lukejagodzinski
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants