googlecodelabs / your-first-pwapp

Code associated with Your First Progressive Web App codelab
https://g.co/codelabs/pwa
Apache License 2.0
638 stars 555 forks source link

Mobile version can request the DarkSky data? #168

Closed SteMMo33 closed 5 years ago

SteMMo33 commented 5 years ago

Hello, thanks for your excellent article and code, I just start the study of the PWAs.

My first step was to run on a Linux PC browser: to make it work I needed to install the dotenv plugin for nodeJS, just to make possible the read of the .env file - otherwise the DARKSKY_API_KEY variable was always undefined. In this way I can request the current forecast data.

Second step was the deploy on Firebase and the installation on my mobile. This is working well but, on the mobile, I never receive the current forecast data, only fake data.

After I studied the architecture of the project and I discovered that the data request is done by the node server on the PC! So, on the mobile solution, how the app can works ??

Thanks!

petele commented 5 years ago

Unfortunately - due to the CORS requirements of the Dark Sky API, you need to use the node server to proxy the data.