{"id":18936341,"url":"https://github.com/shellbear/qleex","last_synced_at":"2026-03-21T02:30:18.046Z","repository":{"id":119546657,"uuid":"182343812","full_name":"shellbear/qleex","owner":"shellbear","description":"A minimal HTTP Middleware router for Crystal.","archived":false,"fork":false,"pushed_at":"2019-04-20T02:03:10.000Z","size":2,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T21:24:24.050Z","etag":null,"topics":["crystal","http","middleware","radix","router"],"latest_commit_sha":null,"homepage":null,"language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shellbear.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-20T01:08:35.000Z","updated_at":"2020-11-23T12:25:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"0a683d6a-f211-4a24-9720-c727421c896b","html_url":"https://github.com/shellbear/qleex","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fqleex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fqleex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fqleex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shellbear%2Fqleex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shellbear","download_url":"https://codeload.github.com/shellbear/qleex/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239937701,"owners_count":19721482,"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","middleware","radix","router"],"created_at":"2024-11-08T12:07:02.719Z","updated_at":"2026-03-21T02:30:18.000Z","avatar_url":"https://github.com/shellbear.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Qleex\n\nA minimal HTTP Middleware router for Crystal.\n\n## Installation\n\nAdd this to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  qleex:\n    github: ShellBear/qleex\n```\n\n## Usage\n\n```crystal\nrequire \"http/server\"\nrequire \"qleex\"\n\nrouter = Qleex::Router.new\n\n# You can define one or more paths for get, post, put, delete, patch and options HTTP methods\nrouter.get(\"/hello\", -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"Hello world!\"\n})\n\nrouter.post(\"/post\", -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"This is POST request\"\n})\n\n# You can define multiple methods for one or more paths.\nrouter.route([\"GET\", \"POST\"], \"/ping\", -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"pong\"\n})\n\n# You can define multiple paths for one or more methods.\nrouter.route(\"GET\", [\"/ex1\", \"/ex2\", \"/ex3\"], -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"You matched one of these URLs: [/ex1, /ex2, /ex3]\"\n})\n\n# You can add parameters to the path by using the \":\" character\nrouter.route(\"GET\", \"/user/:id\", -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"User #{params[\"id\"]}\"\n})\n\n# You can use a wildcard to match everything\nrouter.route(\"GET\", \"/*\", -\u003e (context : Qleex::Context, params : Qleex::Parameters) {\n  context.response.content_type = \"text/plain\"\n  context.response.print \"Wow\"\n})\n\nserver = HTTP::Server.new(router)\n\naddress = server.bind_tcp 8080\nputs \"Listening on http://#{address}\"\nserver.listen\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellbear%2Fqleex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshellbear%2Fqleex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshellbear%2Fqleex/lists"}