From 112666a6fb7d8b54cd627cdf47021844b7b4d6c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=EC=98=88=EC=A7=84?= Date: Fri, 11 Oct 2024 21:05:31 +0900 Subject: [PATCH] chore: add endpoint to health-check --- src/app/routes/api.health.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/app/routes/api.health.tsx diff --git a/src/app/routes/api.health.tsx b/src/app/routes/api.health.tsx new file mode 100644 index 0000000..13bb56a --- /dev/null +++ b/src/app/routes/api.health.tsx @@ -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)); +};