added dynamic path in media directory for nignx host
This commit is contained in:
parent
92cd484212
commit
67ca693ceb
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue