{"id":15011161,"url":"https://github.com/iamnapo/just-the-cors","last_synced_at":"2026-02-23T00:42:11.667Z","repository":{"id":57287442,"uuid":"197243026","full_name":"iamnapo/just-the-cors","owner":"iamnapo","description":"🚧 Tiny middleware to add cors support when using zeit's micro.","archived":false,"fork":false,"pushed_at":"2020-10-09T20:50:21.000Z","size":153,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-07T01:45:46.358Z","etag":null,"topics":["cors","cors-middleware","micro","microservice","nodejs","router","routing","zeit"],"latest_commit_sha":null,"homepage":"","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/iamnapo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-07-16T17:57:54.000Z","updated_at":"2020-10-23T21:24:18.000Z","dependencies_parsed_at":"2022-08-24T23:34:33.393Z","dependency_job_id":null,"html_url":"https://github.com/iamnapo/just-the-cors","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/iamnapo/just-the-cors","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fjust-the-cors","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fjust-the-cors/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fjust-the-cors/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fjust-the-cors/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iamnapo","download_url":"https://codeload.github.com/iamnapo/just-the-cors/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iamnapo%2Fjust-the-cors/sbom","scorecard":{"id":477835,"data":{"date":"2025-08-11","repo":{"name":"github.com/iamnapo/just-the-cors","commit":"0cb8b88ec5c975306fb4521fbe36c75fcd104470"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/19 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/iamnapo/just-the-cors/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/iamnapo/just-the-cors/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/iamnapo/just-the-cors/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/iamnapo/just-the-cors/publish.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/ci.yml:18","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T15:48:38.485Z","repository_id":57287442,"created_at":"2025-08-19T15:48:38.485Z","updated_at":"2025-08-19T15:48:38.485Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281295821,"owners_count":26476760,"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","status":"online","status_checked_at":"2025-10-27T02:00:05.855Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cors","cors-middleware","micro","microservice","nodejs","router","routing","zeit"],"created_at":"2024-09-24T19:39:22.781Z","updated_at":"2025-10-27T16:04:37.061Z","avatar_url":"https://github.com/iamnapo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# just-the-cors\n\n\u003e Tiny middleware to add cors support when using zeit's micro\n\n[![build](https://img.shields.io/github/workflow/status/iamnapo/just-the-cors/ci?style=for-the-badge\u0026logo=github\u0026label=)](https://github.com/iamnapo/just-the-cors/actions) [![npm](https://img.shields.io/npm/v/just-the-cors.svg?style=for-the-badge\u0026logo=npm\u0026label=)](https://www.npmjs.com/package/just-the-cors) [![dependencies](https://img.shields.io/david/iamnapo/just-the-cors.svg?style=for-the-badge)](./package.json) [![license](https://img.shields.io/github/license/iamnapo/just-the-cors.svg?style=for-the-badge)](./LICENSE)\n\n## Install\n\n```console\n$ npm i just-the-cors\n```\n\n## Example\n\n```js\nconst { send } = require(\"micro\");\nconst { router, get } = require(\"microrouter\");\nconst cors = require(\"just-the-cors\");\n\nconst getWithCors = (path, handler) =\u003e get(path, cors(handler));\n\nconst hello = cors((req, res) =\u003e send(res, 200, { message: \"Hello 1!\" }));\nconst hello2 = (req, res) =\u003e {\n\tcors(req, res);\n\treturn send(res, 200, { message: \"Hello 2!\" });\n};\nconst hello3 = (req, res) =\u003e send(res, 200, { message: \"Hello 3!\" });\nconst hello4 = (req, res) =\u003e send(res, 200, { message: \"Hello 4!\" });\n\nmodule.exports = router(\n\tget(\"/hello/1\", hello),\n\tget(\"/hello/2\", hello2),\n\tget(\"/hello/3\", cors(hello3)),\n\toptions(\"/hello/4\", cors(hello4, { autoHandleOptions: false })),\n\tgetWithCors(\"/*\", (req, res) =\u003e send(res, 200, { message: \"Hello in general!\" })),\n);\n```\n\n### Note\n\n\u003e If you don't supply the `res` object as a second argument, `cors` does nothing!\n\n```js\nconst { router, get } = require(\"microrouter\");\nconst cors = require(\"just-the-cors\");\n\nconst hello1 = (req) =\u003e {\n\tcors(req); // Does nothing!\n\treturn \"Hello 1\";\n};\n\nconst hello2 = (req, res) =\u003e {\n\tcors(req, res);\n\treturn \"Hello 2\";\n};\n\nmodule.exports = router(\n\tget(\"/hello1\", hello1), // \"Access-Control-Allow-Origin\": ❌\n\tget(\"/hello2\", hello2) // \"Access-Control-Allow-Origin\": ✅\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnapo%2Fjust-the-cors","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamnapo%2Fjust-the-cors","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamnapo%2Fjust-the-cors/lists"}