{"id":19303840,"url":"https://github.com/web3w/expressjs-mw","last_synced_at":"2025-07-27T13:12:56.341Z","repository":{"id":111889840,"uuid":"283764387","full_name":"web3w/expressjs-mw","owner":"web3w","description":"Expressjs middleware collection","archived":false,"fork":false,"pushed_at":"2020-07-31T07:05:45.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-05T23:42:23.946Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/web3w.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-30T12:13:38.000Z","updated_at":"2020-07-31T07:05:47.000Z","dependencies_parsed_at":"2023-07-09T01:16:15.223Z","dependency_job_id":null,"html_url":"https://github.com/web3w/expressjs-mw","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fexpressjs-mw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fexpressjs-mw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fexpressjs-mw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/web3w%2Fexpressjs-mw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/web3w","download_url":"https://codeload.github.com/web3w/expressjs-mw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240404751,"owners_count":19796064,"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":[],"created_at":"2024-11-09T23:27:42.800Z","updated_at":"2025-02-24T02:13:45.464Z","avatar_url":"https://github.com/web3w.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# expressjs-mw\nExpressjs middleware collection\n\n## install\n``` shell script\nnpm i expressjs-mw\n```\n\n## Base Usage\n```js\nlet express = require('express');\nlet app = express();\nlet mw = require(\"expressjs-mw\")\n\n// 不限制跨域来源\nlet allowList=[/\\.*/]\napp.use(mw.crossOrigin.allowedOrigin(allowList))\n\n```\n\n限制跨域来源，使用正则\n```js\n\nlet allowList= [\"www.g.cn\", /http:\\/\\/localhost*/, /\\*.github.com/]\napp.use(mw.crossOrigin.allowedOrigin(allowList))\n```\n\n限制referer来源，使用正则\n```js\nlet allowList= [\"www.g.cn\", /http:\\/\\/localhost*/, /\\*.github.com/]\napp.use(mw.crossOrigin.allowedReferer(allowList))\n```\n\n[example](./example/index.js)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fexpressjs-mw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fweb3w%2Fexpressjs-mw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fweb3w%2Fexpressjs-mw/lists"}