Skip to content

Latest commit

 

History

History
25 lines (21 loc) · 1.55 KB

File metadata and controls

25 lines (21 loc) · 1.55 KB

Why?

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.

How to use?

  1. fork
  2. git clone
  3. yarn or npm install
  4. get an api key at https://darksky.net/dev/
  5. rename .env.exampe to .env and assign you api key as value to API_KEY.
  6. start server with yarn start
  7. Deploy

The last step only makes sense if you going to build weather app and put it to the web.

What about weather app?

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.