{"repo":"hanami/hanami-router","free":true,"listed":false,"github":"https://github.com/hanami/hanami-router","clone":"git clone https://github.com/hanami/hanami-router.git","description":"Ruby/Rack HTTP router","language":"Ruby","stars":361,"topics":["hanami","ruby","router","http","rest-api","httprouter"],"license":"MIT","category":"api-integrations-sdks","readme_excerpt":"[actions]: https://github.com/hanami/hanami-router/actions [chat]: https://discord.gg/naQApPAsZB [forum]: https://discourse.hanamirb.org [rubygem]: https://rubygems.org/gems/hanami-router Hanami Router [ ][rubygem] [ ][actions] [ ][forum] [ ][chat] Installation Add this line to your application's Gemfile: And then execute: Or install it yourself as: Getting Started Create a file named config.ru From the shell: Usage Hanami::Router is designed to work as a standalone framework or within a context of a Hanami application. For the standalone usage, it supports neat features: A Beautiful DSL: Fixed string matching: String matching with variables: Variables Constraints: String matching with globbing: String matching with optional tokens: Support for the most common HTTP methods: Root: Redirect: Named routes: Scopes: Mount Rack applications: Mounting a Rack application will forward all kind of HTTP requests to the app, when the request path matches the at: path. Duck typed endpoints: Everything that responds to #call is invoked as it is: Implicit Not Found (404): Explicit Not Found: Body Parsers Rack ignores request bodies unless they come from a form submission. If we have a JSON endpoint, the payload isn't available in the params hash: This feature enables body parsing for specific MIME Types. It comes with a built-in JSON parser and allows to pass custom parsers. JSON Parsing If the json can't be parsed an exception is raised: multi json If you want to use a different JSON backe","default_branch":null,"files":null,"tree":[],"storefront":"/r/hanami","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/hanami/hanami-router/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}