Comments (10)
Thanks.
Can you share which URL you are visiting the tool from? Is it https://cloud.withgoogle.com/region-picker/ ?
The tool isn't supposed to load https://cloud.withgoogle.com/data/countries.json but https://cloud.withgoogle.com/region-picker/data/countries.json
from region-picker.
Hi, i believe this is the url https://cloud.withgoogle.com/region-picker i used. Appears the only difference is that it's missing the forward slash at the end.
from region-picker.
Thanks. the URL is https://cloud.withgoogle.com/region-picker/
I can see if it's possible to also support the one you shared.
Out of curiosity, where did you click on the URL without the trailing /
?
from region-picker.
Hi, I'm not sure where I picked the URL from. Possibly typed it in. Hope this helps :)
Hari
from region-picker.
Thanks, I'll see if I can change the App Engine config to be compatible when the URL is missing the trailing /
from region-picker.
Some considerations:
- With a proper slash at https://cloud.withgoogle.com/region-picker/ , all static asset relative paths are implictly rooted at
https://cloud.withgoogle.com/region-picker/
e.g.images/icons/help_outline_black_24dp.svg
is resolved as https://cloud.withgoogle.com/region-picker/images/icons/help_outline_black_24dp.svg - Without a trailing slash at https://cloud.withgoogle.com/region-picker , all static asset relative paths are implictly rooted at
https://cloud.withgoogle.com/
e.g.images/icons/help_outline_black_24dp.svg
is resolved as https://cloud.withgoogle.com/images/icons/help_outline_black_24dp.svg , which is incorrect and returns a 302 to https://cloud.google.com/
The App Engine config LGTM, I'm not aware of any special power beyond "at the root of the current app, serve index.html".
However, the app in production lives under https://cloud.withgoogle.com/ which serves the sub-paths region-picker
and region-picker/
alike by letting the appropriate App Engine app serve them. This creates confusion about the proper root path of the relative static assets.
Here are a few possible mitigations I can think of:
- Wherever the "wrong" URL exists in hyperlinks in the wild, change them with the "proper" URL with trailing slash ;
- Kindly ask the admins of
cloud.withgoogle.com
if they can return a 404 for the "wrong" URL. Not friendly, but much better that the current mostly-broken page ; - Kindly ask the admins of
cloud.withgoogle.com
if they can return a 302 for the "wrong" URL, that seamlessly redirects to the proper URL ; - Modify all of the relative paths in the app code to include as prefix the virtual folder "/region-picker/" e.g.
background-image: url(images/icons/gleaf_black_24dp.svg);
becomesbackground-image: url(/region-picker/images/icons/gleaf_black_24dp.svg);
. The app.yaml is already set up to accommodate this trick. This can only be achieved by making sure that all the internal relative static resource paths do start with the prefix ; - Add a JS workaround hack that "checks if
window.location
is missing the trailing slash, if so make a redirect" ; - Change all of the relative paths into full absolute paths with production domain name (not great as the app is not self-contained anymore, and local dev becomes awkward).
It seems to me that (3), (4), (5) are actionable and would each be able to fix the problem.
@steren would you like me to try and make a PR for (4) or (5)?
Note that the whole thing is a bit error-prone, and we'll need to test carefully after a redeploy.
from region-picker.
Thanks for the suggestions.
- yes, it'd be good to check for where this URL is incorrect in the wild and send PRs
I think 3. would be best. but not sure what's feasible.
I would prefer the app not to assume it is served under /region-picker/
in case users want to deploy it somewhere else. So I am against 4.
I suggest to do 5. Feel free to send a PR.
from region-picker.
Implemented 5. in PR #8
from region-picker.
Thanks. Merged. It should auto-deploy. let's close once we confirm the issue is fixed
from region-picker.
This is indeed deployed in prod, and LGTM
from region-picker.
Related Issues (17)
- Icons for dark mode HOT 1
- Product regional availability HOT 4
- Save Countries Selected and add to output HOT 3
- Please add me-west1 region HOT 1
- Hong Kong region (asia-east2) not showing as top pick for traffic coming from Hong Kong HOT 2
- Use a official pricing CSV export instead of manual JSON
- support regions with no carbon data HOT 1
- Display more info in results HOT 1
- Add view transitions HOT 1
- Product list sometimes shows duplicates
- add me-central2 region HOT 2
- Store parameters in URL HOT 1
- Measure real latency to GCP region instead of using current location HOT 3
- Add Warsaw (europe-central2) HOT 2
- Some high carbon regions have 3 leaves HOT 1
- Carbon footprint rating HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from region-picker.