{"id":16723205,"url":"https://github.com/martinkr/corsify","last_synced_at":"2025-03-21T21:30:56.769Z","repository":{"id":25142422,"uuid":"103287071","full_name":"martinkr/corsify","owner":"martinkr","description":"A tiny transparent proxy. The benefit: it adds the CORS-headers! Why? It prevents Cross Domain Errors.","archived":false,"fork":false,"pushed_at":"2024-12-08T18:00:55.000Z","size":121,"stargazers_count":24,"open_issues_count":21,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T05:12:30.166Z","etag":null,"topics":["ajax","ajax-request","cors","cors-headers","cors-middleware","cors-proxy","cors-request","cross-domain","development","docker","node","nodejs","xhr"],"latest_commit_sha":null,"homepage":"http://corsify.me","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/martinkr.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-09-12T15:17:38.000Z","updated_at":"2024-12-02T04:12:46.000Z","dependencies_parsed_at":"2024-04-06T04:22:16.197Z","dependency_job_id":"b6468f20-34ef-487a-827e-4ac198d22a6d","html_url":"https://github.com/martinkr/corsify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinkr%2Fcorsify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinkr%2Fcorsify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinkr%2Fcorsify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinkr%2Fcorsify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinkr","download_url":"https://codeload.github.com/martinkr/corsify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244874154,"owners_count":20524576,"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":["ajax","ajax-request","cors","cors-headers","cors-middleware","cors-proxy","cors-request","cross-domain","development","docker","node","nodejs","xhr"],"created_at":"2024-10-12T22:37:23.326Z","updated_at":"2025-03-21T21:30:56.404Z","avatar_url":"https://github.com/martinkr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# corsify [![Build Status](https://travis-ci.org/martinkr/corsify.svg?branch=master)](https://travis-ci.org/martinkr/corsify)\nA tiny transparent proxy. The benefit: it adds the CORS-headers! Why? It prevents Cross Domain Errors.\n\nTry it: [http://corsify.me](http://corsify.me)\n- Without CORS-headers: [http://shaky-library.surge.sh](http://shaky-library.surge.sh)\n- With CORS-headers aka \"corsyfied\": [http://localhost:3001/http://shaky-library.surge.sh](http://localhost:3001/http://shaky-library.surge.sh)\n\n## CORS-i-fy? What is this all about?\n \u003e Cross-origin resource sharing (CORS) is a mechanism that allows restricted resources (e.g. fonts) on a web page to be requested from another domain outside the domain from which the resource originated. [https://en.wikipedia.org/wiki/Cross-origin_resource_sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)\n\n## Wait… What?!\nYour script from http://rebel-mother.surge.sh makes an AJAX-request to http://shaky-library.surge.sh. \u003cbr/\u003e\nYou see the infamous \"XMLHttpRequest cannot load http://shaky-library.surge.sh. Origin http://rebel-mother.surge.sh is not allowed by Access-Control-Allow-Origin.\" error message.\n\n## corsify to the rescue!\nChange your AJAX-Request from http://shaky-library.surge.sh to http://localhost:3001/http://shaky-library.surge.sh. Et voilá: no more errors.\n\n## So simple?\nFor now: yes.\n\n\n## Roll our own!\n``` $ git clone https://github.com/martinkr/corsify.git``` the repository and fire up your own local instance with docker or plain node.js.\n\n### With the included Dockerfile\nFast and clean. No additional files on your machine.\n- Build the image: ```$ docker build -t corsify:latest . ```\n- Start the container: ```$ docker run -p 3001:3000 corsify:latest```\n- Go to: [http://localhost:3001](http://localhost:3001)\n\nUses ``` alpine:3.6``` and ```node:8.4.0```.\n\n\n### Directly on your machine:\nFast and easy, but all those node_modules…\n- Install dependencies ```$ npm install``` or ```$ yarn ```\n- Build the files and start server ```$ npm start``` or ```$ yarn start ```\n- Go to: [http://localhost:3000](http://localhost:3000)\n\nRequires ```nodejs```. Recomended: ```v8.4.0```, but it might work with older versions too.\n\n# Tech Stack\n- ECMAScript 2015 on ```nodejs v8.4.0```\n- Rendering ```Mustache v2.3.0``` templates\n- CSS 3 piped through ```postcss-cli v4.1.1``` with ```cssnano v3.10.0``` and ```cssnano-preset-advanced v4.0.0-rc.2```,\n- Running on ```express`v4.14.1```\n- With ```forever v0.15.3```\n- And gzip ```compression v1.7.0```\n- 100% code coverage using ```mocha v3.5.2```, ```chai v4.1.2```, ```supertest v3.0.0``` and ``` \"nyc 11.2.1\"```,\n\n## Resources\n- [https://enable-cors.org](https://enable-cors.org)\n- [https://en.wikipedia.org/wiki/Cross-origin_resource_sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)\n- [https://www.html5rocks.com/en/tutorials/cors](https://www.html5rocks.com/en/tutorials/cors)\n\n## License\nLicensed under the [MIT license](http://www.opensource.org/licenses/mit-license.php).\n\nCopyright (c) 2016 - 2021 Martin Krause \u003cgithub@mkrause.info\u003e [http://martinkr.github.io](http://martinkr.github.io)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinkr%2Fcorsify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinkr%2Fcorsify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinkr%2Fcorsify/lists"}