Closed ckolderup closed 9 months ago
FWIW, I had the same issue since I was self-hosting outside of Glitch. I think it's a good idea to use something like PUBLIC_BASE_URL so the name is less ambiguous (BASE_URL could refer to a local or public URL).
@steve-bate good point, thank you! Revising. And thanks for the review @benbrown.
As a documented hack I was previously requesting that people go into
src/utils.js
and override the definition ofconst domain
. That worked okay but had some downsides:This change provides a newly detected environment variable, BASE_URL, which you can (for example) set to the value
bookmarks.example.com
if you are setting the instance up to be available at the URL https://bookmarks.example.com. Because this takes precedence, you can even use it in a Glitch project, if you've signed up to beta test the upcoming custom domain feature.If you don't set a BASE_URL, the code will look for a PROJECT_DOMAIN, which it will assume came from a Glitch container and form a base url of the format
${PROJECT_DOMAIN}.glitch.me
, and if you have neither, it will assume that you're just doing some testing onlocalhost
and use that for some URLs that get generated.Closes #111 -- reached out to the issue creator to confirm.