diff --git a/libraries/react-shared-libraries/src/helpers/use.media.directory.ts b/libraries/react-shared-libraries/src/helpers/use.media.directory.ts index 3484c6459..042a4e4d8 100644 --- a/libraries/react-shared-libraries/src/helpers/use.media.directory.ts +++ b/libraries/react-shared-libraries/src/helpers/use.media.directory.ts @@ -5,7 +5,8 @@ export const useMediaDirectory = () => { if (path.indexOf('https') === 0) { return path; } - return `http://localhost/${path}`; + const urlWithoutPort = process.env.NEXT_PUBLIC_BACKEND_URL!.split(':').slice(0, 2).join(':'); + return `${urlWithoutPort}/${path}`; }, []); return {