load api files through a remix route

This commit is contained in:
MapleLeaf
2022-01-12 13:31:50 -06:00
parent 785384286b
commit cda69a0c85
3 changed files with 9 additions and 2 deletions

View File

@@ -0,0 +1,7 @@
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["*"]}`)
}