{"id":16726921,"url":"https://github.com/lpil/plug-redirect","last_synced_at":"2025-10-12T09:36:56.806Z","repository":{"id":57534972,"uuid":"52528377","full_name":"lpil/plug-redirect","owner":"lpil","description":"A plug builder for redirecting requests.","archived":false,"fork":false,"pushed_at":"2018-11-17T16:59:59.000Z","size":16,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-07T02:25:35.793Z","etag":null,"topics":["elixir","plug","plug-builder","redirect"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lpil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-25T13:58:30.000Z","updated_at":"2023-09-10T10:58:00.000Z","dependencies_parsed_at":"2022-09-26T18:21:48.366Z","dependency_job_id":null,"html_url":"https://github.com/lpil/plug-redirect","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lpil/plug-redirect","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Fplug-redirect","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Fplug-redirect/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Fplug-redirect/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Fplug-redirect/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lpil","download_url":"https://codeload.github.com/lpil/plug-redirect/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lpil%2Fplug-redirect/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279001866,"owners_count":26083226,"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-09T02:00:07.460Z","response_time":59,"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":["elixir","plug","plug-builder","redirect"],"created_at":"2024-10-12T22:55:12.955Z","updated_at":"2025-10-12T09:36:56.791Z","avatar_url":"https://github.com/lpil.png","language":"Elixir","readme":"PlugRedirect\n============\n\n[![Build Status](https://travis-ci.org/lpil/plug-redirect.svg?branch=master)](https://travis-ci.org/lpil/plug-redirect)\n[![Hex version](https://img.shields.io/hexpm/v/plug_redirect.svg \"Hex version\")](https://hex.pm/packages/plug_redirect)\n[![Hex downloads](https://img.shields.io/hexpm/dt/plug_redirect.svg \"Hex downloads\")](https://hex.pm/packages/plug_redirect)\n\nA plug builder for redirecting requests.\n\n\n## Usage\n\nAdd PlugRedirect to your Mix dependencies\n\n```elixir\n# mix.exs\ndef deps do\n  [\n    {:plug_redirect, \"~\u003e 1.0\"},\n  ]\nend\n```\n\nFetch it:\n\n```\nmix deps.get\n```\n\nCreate a new module and specify your redirects like so:\n\n```elixir\ndefmodule MyApp.Redirector do\n  use Plug.Redirect\n\n  # Argument #1 is the path to redirect from\n  # Argument #2 is the path to redirect to\n  redirect \"/ada\", \"/lovelace\"\n\n  # An HTTP status code can also be specified\n  redirect \"/grace\", \"/hopper\", status: 302\n\n  # Segements prefixed with a colon will match anything\n  redirect \"/blog/:anything\", \"/blog-closed\"\n\n  # Variable segments can be interpolated into the destination\n  redirect \"/users/:name\", \"/profile/:name\"\nend\n```\n\nThis compiles into a plug that you can insert into your application's\nplug middleware stack.\n\nIn Phoenix, insert the plug in your web application Endpoint.\n\n```elixir\ndefmodule MyApp.Endpoint do\n  use Phoenix.Endpoint, otp_app: :my_app\n\n  plug Plug.RequestId\n  plug Plug.Logger\n  plug Plug.MethodOverride\n  plug Plug.Head\n\n  plug MyApp.Redirector # Insert your redirector anywhere before the router\n  plug MyApp.Router\nend\n```\n\n\n# LICENCE\n\n```\nPlugRedirect\nCopyright © 2016 - Present Louis Pilfold - MIT Licence\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the \"Software\"),\nto deal in the Software without restriction, including without limitation\nthe rights to use, copy, modify, merge, publish, distribute, sublicense,\nand/or sell copies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE\nOR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpil%2Fplug-redirect","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flpil%2Fplug-redirect","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flpil%2Fplug-redirect/lists"}