{"id":18521778,"url":"https://github.com/transferwise/cable","last_synced_at":"2025-04-09T09:33:24.170Z","repository":{"id":55535694,"uuid":"92497875","full_name":"transferwise/cable","owner":"transferwise","description":"Simple and minimalistic url rewriter","archived":true,"fork":false,"pushed_at":"2024-04-04T23:36:15.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":115,"default_branch":"master","last_synced_at":"2025-02-13T19:18:26.929Z","etag":null,"topics":["url-rewrite"],"latest_commit_sha":null,"homepage":"","language":"Java","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/transferwise.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2017-05-26T10:01:58.000Z","updated_at":"2024-12-06T14:25:48.000Z","dependencies_parsed_at":"2024-11-06T17:35:32.242Z","dependency_job_id":"f7fe0607-ab5c-4e0d-86d8-153a7baa3b93","html_url":"https://github.com/transferwise/cable","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/transferwise%2Fcable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fcable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fcable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transferwise%2Fcable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transferwise","download_url":"https://codeload.github.com/transferwise/cable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694892,"owners_count":20980731,"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":["url-rewrite"],"created_at":"2024-11-06T17:27:35.305Z","updated_at":"2025-04-09T09:33:23.625Z","avatar_url":"https://github.com/transferwise.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cable [![CircleCI](https://circleci.com/gh/transferwise/cable/tree/master.svg?style=shield)](https://circleci.com/gh/transferwise/cable/tree/master) [![GitHub release](https://jitpack.io/v/transferwise/cable.svg)](https://github.com/transferwise/cable/releases/latest)\n\nA simple and minimalistic url rewrite module.\n\n## Installation\n\nJust add the following configuration to your `build.gradle` file\n\n```gradle\nallprojects {\n    repositories {\n        maven { url 'https://jitpack.io' }\n    }\n}\n\ndependencies {\n    compile 'com.github.transferwise.cable:cable-starter:2.0.0'\n}\n```\n\nIf you want to use the servlet filters by your own avoiding auto-configuration, just include the `cable-core` dependency\n\n```gradle\ncompile 'com.github.transferwise.cable:cable-core:2.0.0'\n```\n\n## Configuration\n\nUsing the starter module you can easily add new rewrite rules to your `application.yml`\n\n```yaml\ncable:\n  rewrites:\n    - {from: \"/path\", to: \"/more/interesting/path\"}\n    - {from: \"^/([a-z]{2})/(.*)$\", to: \"/$1/blog/$2\"}\n}\n```\n\n## Usage\n\nIn Thymeleaf templates it will work automatically with link url expressions `@{...}`\n\n```html\n\u003ca th:href=\"@{/test}\"\u003eThis is a test\u003c/a\u003e\n```\n\nIt will also automatically work on redirects within your controllers.\n\n## Advanced usage\n\nYou can use lambda functions tu create more complex filters, so you will rewrite the url under controlled circumstances.\n\nLet's imagine you want to rewrite only the urls of requests served under \"/path\":\n\n\n```java \n@Bean\npublic Filter urlRewriteFilter() {\n    return new UrlRewriteFilter()\n        .rewrite(\"/test\", \"/test2\", r -\u003e r.getRequestURI().contains(\"/path\"));\n}\n``` \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Fcable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransferwise%2Fcable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransferwise%2Fcable/lists"}