Don't call the root loader on /healthcheck route #7543
-
| 
         I'm fighting with this problem for a very long time already. So far, I always was able to somehow find a workaround but this time I can't. Fly.io calls   | 
  
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
| 
         In your root loader, you can check the pathname. That way, you don't trigger the 503 response. export function loader({ request }: DataFunctionArgs) {
  const url = new URL(request.url);
  if (url.pathname === "/healthcheck") {
    return json({ message: "ok" });
  }
  return json({ message: "hello world" });
} | 
  
Beta Was this translation helpful? Give feedback.
-
| 
         Glad to find this discussion while working on a Remix v1 legacy codebase deployed on fly.io. This was really helpful to understand things better, even after 2 years!  | 
  
Beta Was this translation helpful? Give feedback.
Actually, the final solution that I used was to modify only the
/healthcheckroute.Leaving it here for posterity: