Skip to content

stephmod/cors-proxy-github

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

cors-proxy-github

I ran into a CORS error when making requests to GitHub from a client-side application in development. As a solution, I built a Firebase cloud function to serve as a proxy, using express middleware to add a necessary Access-Control-Allow-Origin: * header. The function then returns the requested JSON data to the application.

Try it out!

The Firebase cloud function is live to use. Simply replace the URL parameters with your target path: /:gituser/:repo/:file/:token?. The token paramter is optional and is intended for use with private repos.

curl https://us-central1-cors-proxy-github.cloudfunctions.net/app/stephmod/cors-proxy-github/example

Resource

https://medium.com/@dtkatz/3-ways-to-fix-the-cors-error-and-how-access-control-allow-origin-works-d97d55946d9

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published