If you going to build weather app or doing it right now hundred percent you encountered (or will do it) an issue. The issue
is No 'Access-Control-Allow-Origin' header is present on the requested resource message in console when you try to fetch weather data from
dark sky api. It turns out weather provider have disabled cross-origin resource sharing (CORS)
on their servers. Actually you can read about it here.
Below is excerption from faq section
To prevent API key abuse, you should set up a proxy server to make calls to our API behind the scenes. Then you can provide forecasts to your clients without exposing your API key.
- fork
git cloneyarnornpm install- get an api key at https://darksky.net/dev/
- rename
.env.exampeto.envand assign you api key as value toAPI_KEY. - start server with
yarn start
The last step only makes sense if you going to build weather app and put it to the web.
The fact you got interested in this repo usually means you have already built weather app or you are going to do it.
I built a very simple weather app, you can find it here.
Feel free to git clone and investigate it if you are struggle to build one or even don't know how to start.