Skip to content

Commit

Permalink
added dynamic path in media directory for nignx host
Browse files Browse the repository at this point in the history
  • Loading branch information
SanadKhan committed Sep 23, 2024
1 parent 92cd484 commit 67ca693
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 67ca693

Please sign in to comment.