{"id":22941487,"url":"https://github.com/das-jishu/add-cors","last_synced_at":"2025-08-12T21:32:00.072Z","repository":{"id":46628926,"uuid":"382512642","full_name":"das-jishu/add-cors","owner":"das-jishu","description":"A simple Node proxy to attach CORS headers to a response of a queried request to an endpoint.","archived":false,"fork":false,"pushed_at":"2021-10-03T03:20:44.000Z","size":112,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-06T21:10:41.291Z","etag":null,"topics":["add-cors","cors","cors-proxy","nodejs","proxy","proxy-server"],"latest_commit_sha":null,"homepage":"https://attach-cors.herokuapp.com/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/das-jishu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-03T03:06:50.000Z","updated_at":"2022-11-14T04:37:26.000Z","dependencies_parsed_at":"2022-08-29T13:31:52.287Z","dependency_job_id":null,"html_url":"https://github.com/das-jishu/add-cors","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/das-jishu%2Fadd-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/das-jishu%2Fadd-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/das-jishu%2Fadd-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/das-jishu%2Fadd-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/das-jishu","download_url":"https://codeload.github.com/das-jishu/add-cors/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229709547,"owners_count":18111449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["add-cors","cors","cors-proxy","nodejs","proxy","proxy-server"],"created_at":"2024-12-14T13:40:21.099Z","updated_at":"2024-12-14T13:40:21.706Z","avatar_url":"https://github.com/das-jishu.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# add-cors\n\n![Add CORS cover image](https://github.com/das-jishu/add-cors/blob/master/images/add-cors-cover.png?raw=true)\n\n [![Build Status](https://travis-ci.com/das-jishu/add-cors.svg?branch=master)](https://travis-ci.com/github/das-jishu/add-cors)\n [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT \"MIT License\")\n ![GitHub repo size](https://img.shields.io/github/repo-size/das-jishu/add-cors)\n [![Active](http://img.shields.io/badge/Status-Active-green.svg)](https://github.com/das-jishu/add-cors)\n [![Generic badge](https://img.shields.io/badge/framework-node-yellow.svg)](https://www.typescriptlang.org/)\n \n**Description:** A Node proxy to add CORS headers to a request made to an API endpoint.\n\n#\n \n![Image of error due to blockage by CORS policy](https://github.com/das-jishu/add-cors/blob/master/images/no-cors-error.PNG?raw=true)\n\n\u003cbr--\u003e\nThe image above shows a response blocked due to CORS policy not satisfied since correct headers were not present on the response. Frontend code won't have access to responses if responses don't have CORS headers embedded in it. If the backend server is owned by you, you can add the headers to solve the problem. If it isn't owned by you, a proxy server comes into play.\n \n#\n\n### HOW TO USE\n\n**BASE URL:** https://attach-cors.herokuapp.com/\n\nAppend the base URL infront of the API endpoint and perform the request as usual. The request will be passed through the proxy to get the response. CORS headers will be added to the response and sent back.\n\n```JS\n   fetch(\"some-API-with-no-CORS\")                                    // ERROR\n   fetch(\"https://attach-cors.herokuapp.com/some-API-with-no-cors\")  // SUCCESS\n```\n\nNote that it is a public proxy with rate limiting applied, so responses might be delayed. A better approach would be to create your own proxy server to handle the requests. This can be done with the following commands:\n\n```bash\n   git clone https://github.com/das-jishu/add-cors.git\n   cd add-cors/\n   npm install\n   heroku create cors-everywhere //cors-everywhere is an example. Use a unique name for heroku to create.\n   git push heroku master\n```\n\nPrerequisites: [Installing the Heroku CLI](https://devcenter.heroku.com/articles/heroku-cli)\n\nAfter executing the above commands, your own server would be running and available at https://cors-everywhere.herokuapp.com/\nYou can make requests to endpoints simply by attaching the URL infront of it.\n\nExample: https://cors-everywhere.herokuapp.com/http://www.check-cors.com\n \n#\n\n### EXTRAS\n\nFeel free to add any additional features by creating a pull request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdas-jishu%2Fadd-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdas-jishu%2Fadd-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdas-jishu%2Fadd-cors/lists"}