diff --git a/packages/website/.gitignore b/packages/website/.gitignore index 07279f7..4e8620f 100644 --- a/packages/website/.gitignore +++ b/packages/website/.gitignore @@ -4,7 +4,7 @@ node_modules /build /public/build .env -/public/api +/public/api-dist cypress/videos cypress/screenshots *.out.css diff --git a/packages/website/app/routes/api.$.tsx b/packages/website/app/routes/api.$.tsx new file mode 100644 index 0000000..7851128 --- /dev/null +++ b/packages/website/app/routes/api.$.tsx @@ -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["*"]}`) +} diff --git a/packages/website/typedoc.json b/packages/website/typedoc.json index d4e4f76..9bc2a7d 100644 --- a/packages/website/typedoc.json +++ b/packages/website/typedoc.json @@ -1,6 +1,6 @@ { "entryPoints": ["../reacord/library/main.ts"], - "out": ["public/api"], + "out": ["public/api-dist"], "tsconfig": "../reacord/tsconfig.json", "excludeInternal": true, "excludePrivate": true,