Skip to content

IP-Developer/darksky-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

darksky-proxy

A serverless proxy for Dark Sky API

Motivation

If you try to use the Dark Sky API from a web browser you'll get an error, "No 'Access-Control-Allow-Origin' header is present on the requested resource". That's because Dark Sky don't allow cross-origin requests to avoid clients exposing their API keys.

You can read more about it in the official FAQ.

Solution

To make requests to the Dark Sky API from a web browser (client) we can use a proxy (server). The client makes requests to the proxy (which allows CORS) and the proxy resends these requests to the Dark Sky API, adding the API key to the request. When the API answers the request made by the proxy, the proxy resends the API response to the client.

This proxy can be hosted for free using Netlify Functions with one click on the following button.

Deploy to Netlify

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published