Skip to content

Commit

Permalink
chore: add endpoint to health-check
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Oct 11, 2024
1 parent bc15d9a commit 112666a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/app/routes/api.health.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { LoaderFunction } from '@remix-run/node';

const apiURL = new URL(process.env.API_BASE_URL ?? '');

export const loader: LoaderFunction = async (args) => {
const url = new URL(args.request.url);
url.protocol = apiURL.protocol;
url.host = apiURL.host;
url.port = apiURL.port;

return fetch(url.toString(), new Request(args.request));
};

0 comments on commit 112666a

Please sign in to comment.