{"id":21939187,"url":"https://github.com/grottopress/unslash","last_synced_at":"2025-06-22T05:36:35.409Z","repository":{"id":85788272,"uuid":"439653870","full_name":"GrottoPress/unslash","owner":"GrottoPress","description":"A Crystal HTTP Handler to remove trailing slashes from URLs","archived":false,"fork":false,"pushed_at":"2023-08-23T12:38:24.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-27T14:49:05.955Z","etag":null,"topics":["crystal","http-handler"],"latest_commit_sha":null,"homepage":"","language":"Crystal","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/GrottoPress.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-12-18T15:48:01.000Z","updated_at":"2023-12-20T18:10:28.000Z","dependencies_parsed_at":"2024-11-29T02:17:29.425Z","dependency_job_id":"4434bcd0-5fae-4e57-8058-ac8a704e1b58","html_url":"https://github.com/GrottoPress/unslash","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/GrottoPress%2Funslash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Funslash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Funslash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GrottoPress%2Funslash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GrottoPress","download_url":"https://codeload.github.com/GrottoPress/unslash/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244973695,"owners_count":20541022,"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":["crystal","http-handler"],"created_at":"2024-11-29T02:17:18.769Z","updated_at":"2025-03-22T14:43:42.236Z","avatar_url":"https://github.com/GrottoPress.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Unslash\n\n**Unslash** is a *Crystal* HTTP handler that removes slashes (`/`) at the end of URLs, performing a redirect to the unslashed version of the same URL.\n\nThis, among others, improves SEO by avoiding duplicated content across the different versions of the same URL.\n\n## Installation\n\n1. Add the dependency to your `shard.yml`:\n\n   ```yaml\n   dependencies:\n     unslash:\n       github: GrottoPress/unslash\n   ```\n\n1. Run `shards update`\n\n1. Require *Unslash*:\n\n   ```crystal\n   # ...\n   require \"unslash\"\n   # ...\n   ```\n\n## Usage\n\nPass an instance of `Unslash::Handler` to the web server. If using a web framework, this handler should be passed before the framework's route handler:\n\n```crystal\n# ...\nrequire \"http/server\"\nrequire \"unslash\"\n\nserver = HTTP::Server.new([\n  # If `safe` is `true`, only `GET` and `HEAD` request methods\n  # are handled.\n  Unslash::Handler.new(status_code: 308, safe: false),\n  # ...\n])\n\nserver.bind_tcp(\"127.0.0.1\", 8080)\nserver.listen\n# ...\n```\n\n## Development\n\nRun tests with `crystal spec`.\n\n## Contributing\n\n1. [Fork it](https://github.com/GrottoPress/unslash/fork)\n1. Switch to the `master` branch: `git checkout master`\n1. Create your feature branch: `git checkout -b my-new-feature`\n1. Make your changes, updating changelog and documentation as appropriate.\n1. Commit your changes: `git commit`\n1. Push to the branch: `git push origin my-new-feature`\n1. Submit a new *Pull Request* against the `GrottoPress:master` branch.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Funslash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrottopress%2Funslash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrottopress%2Funslash/lists"}