{"id":13447191,"url":"https://github.com/ExpressGateway/express-gateway-plugin-rewrite","last_synced_at":"2025-03-21T17:30:58.371Z","repository":{"id":39458964,"uuid":"103309258","full_name":"ExpressGateway/express-gateway-plugin-rewrite","owner":"ExpressGateway","description":"A plugin to rewrite urls for Express Gateway","archived":false,"fork":false,"pushed_at":"2023-01-23T20:36:42.000Z","size":1566,"stargazers_count":11,"open_issues_count":11,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-18T11:04:31.701Z","etag":null,"topics":["express-gateway","express-plugin"],"latest_commit_sha":null,"homepage":"https://www.express-gateway.io/docs/policies/rewrite","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ExpressGateway.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":"2017-09-12T18:56:12.000Z","updated_at":"2021-12-17T18:28:39.000Z","dependencies_parsed_at":"2023-02-01T06:45:33.455Z","dependency_job_id":null,"html_url":"https://github.com/ExpressGateway/express-gateway-plugin-rewrite","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressGateway%2Fexpress-gateway-plugin-rewrite","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressGateway%2Fexpress-gateway-plugin-rewrite/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressGateway%2Fexpress-gateway-plugin-rewrite/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExpressGateway%2Fexpress-gateway-plugin-rewrite/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExpressGateway","download_url":"https://codeload.github.com/ExpressGateway/express-gateway-plugin-rewrite/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244239805,"owners_count":20421345,"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":["express-gateway","express-plugin"],"created_at":"2024-07-31T05:01:10.555Z","updated_at":"2025-03-21T17:30:57.988Z","avatar_url":"https://github.com/ExpressGateway.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# express-gateway-plugin-rewrite\n\nThis plugin for [Express Gateway](https://express-gateway.io) makes it possible to redirect (rewrite internally or\nredirect using HTTP codes) User to the specific URL based on\n[Express Paths](https://expressjs.com/en/guide/routing.html) or RegExp Rules.\n\n## Installation\n\nSimply type from your shell environment:\n\n```bash\neg plugin install express-gateway-plugin-rewrite\n```\n\n## Quick start\n\n1. Make sure the plugin is listed in [system.config.yml file](https://www.express-gateway.io/docs/configuration/system.config.yml/).\nThis is done automatically for you if you used the command above.\n\n2. Add the configuration keys to [gateway.config.yml file](https://www.express-gateway.io/docs/configuration/gateway.config.yml/).\n\n```yaml\npolicies:\n  -\n    rewrite:\n      -\n        condition:\n          name: pathmatch\n          match: /tina/:code\n        action:\n          rewrite: /status/:code\n          redirect: 302\n      -\n        condition:\n          name: regexpmatch\n          match: ^/js/(.*)$\n        action:\n          rewrite: /src/js/$1\n```\n\n### Configuration Parameters\n\n`condition.pathmatch`: Express Path corresponding to the url pattern to look for.\n\n`condition.regexpmatch`: RegExp corresponding to the url pattern to look for.\n\n**Note:** if you provide both expression, the first one that will match will make the Gateway jump to the policy\ndirectly.\n\n`action.rewrite`: Express Path or RegExp corresponding to the url pattern to rewrite. The format should match the\none used in the condition.\n\n`action.redirect`: If omitted, a rewrite action will be performed. When set to a number, it'll redirect the request\nwith the provided status code.\n\n## Want to make your own plugin?\n\nJust check out our [plugin development guide](https://www.express-gateway.io/docs/plugins/).\nWe can't wait to see your custom stuff in the Gateway!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FExpressGateway%2Fexpress-gateway-plugin-rewrite","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FExpressGateway%2Fexpress-gateway-plugin-rewrite","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FExpressGateway%2Fexpress-gateway-plugin-rewrite/lists"}