Add url for public assets

This commit is contained in:
Sean Norwood 2022-10-18 15:08:59 -05:00
parent 2e213376e3
commit 7389ed0b2b
Failed to extract signature
2 changed files with 2 additions and 2 deletions

View File

@ -29,7 +29,7 @@ export const meta: MetaFunction = () => ({
export async function loader({ request }: LoaderArgs) {
return {
ENV: {
API_URL: process.env.API_URL,
PUBLIC_API_URL: process.env.PUBLIC_API_URL,
},
};
}

View File

@ -10,7 +10,7 @@ export const loader: LoaderFunction = async ({ context, request }) => {
const { data } = await getVideos(API_KEY);
const withVideoThumbs = data.map((d) => ({
...d,
resolved_thumb_url: `http://localhost:8000${d.vid_thumb_url}`,
resolved_thumb_url: `${process.env.PUBLIC_API_URL}${d.vid_thumb_url}`,
}));
return withVideoThumbs;