Files
reacord/packages/website/app/routes/api.$.tsx
2022-01-12 13:31:50 -06:00

8 lines
318 B
TypeScript

import type { LoaderFunction } from "remix"
// loading the api through a resource route lets us receive analytics and remix server logs for api pages
export const loader: LoaderFunction = ({ request, params }) => {
const url = new URL("/", request.url)
return fetch(`${url.toString()}/api-dist/${params["*"]}`)
}