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)); +};