Closed mircealungu closed 1 week ago
I have tried to replace the default with: window.location.hostname
, which returns 'deploy-preview-394--voluble-nougat-015dd1.netlify.app'
, but it seems that netlify still has the server defaults:
So this would mean that it's loading the environment variables through NPM, I think that would mean that it's somehow in the deploy scripts for it. I am not sure where I can find those?
Using window.location.origin
seems to work!
However, I had to comment out the process.env.REACT_APP_WEB_URL
, so now I am quite sure that the environment variable is set somewhere for netlify
.
Fixed in: https://github.com/zeeguu/web/pull/394
After PR https://github.com/zeeguu/web/pull/393 images don't load anymore on netlify.
e.g. when trying to preview the changes in https://github.com/zeeguu/web/pull/394 this is how it looks
The problem is that with the new image path function, the images are loaded by default from zeeguu.org, but they are not there yet. What we might want to do is to not hardcode the zeeguu.org as default but rather, try to detect automatically the domain on which the app is currently deployed and use that as default.