{"id":13693356,"url":"https://github.com/onyxframework/http","last_synced_at":"2025-08-19T08:07:55.000Z","repository":{"id":55123482,"uuid":"107672462","full_name":"onyxframework/http","owner":"onyxframework","description":"An opinionated framework for scalable web 🌎","archived":false,"fork":false,"pushed_at":"2019-08-25T17:33:13.000Z","size":695,"stargazers_count":142,"open_issues_count":7,"forks_count":11,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-19T21:58:06.930Z","etag":null,"topics":["crystal","framework","http-handler","modular","onyxframework","router","web","websockets"],"latest_commit_sha":null,"homepage":"https://onyxframework.com/http","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/onyxframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-20T11:56:43.000Z","updated_at":"2024-10-23T23:40:22.000Z","dependencies_parsed_at":"2022-08-14T12:40:42.986Z","dependency_job_id":null,"html_url":"https://github.com/onyxframework/http","commit_stats":null,"previous_names":["vladfaust/prism"],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/onyxframework/http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onyxframework%2Fhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onyxframework%2Fhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onyxframework%2Fhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onyxframework%2Fhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/onyxframework","download_url":"https://codeload.github.com/onyxframework/http/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/onyxframework%2Fhttp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271121168,"owners_count":24702723,"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-08-19T02:00:09.176Z","response_time":63,"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":["crystal","framework","http-handler","modular","onyxframework","router","web","websockets"],"created_at":"2024-08-02T17:01:08.785Z","updated_at":"2025-08-19T08:07:54.978Z","avatar_url":"https://github.com/onyxframework.png","language":"Crystal","readme":"\u003ca href=\"https://onyxframework.org\"\u003e\u003cimg width=\"100\" height=\"100\" src=\"https://onyxframework.org/img/logo.svg\"\u003e\u003c/a\u003e\n\n# Onyx::HTTP\n\n[![Built with Crystal](https://img.shields.io/badge/built%20with-crystal-000000.svg?style=flat-square)](https://crystal-lang.org/)\n[![Travis CI build](https://img.shields.io/travis/onyxframework/http/master.svg?style=flat-square)](https://travis-ci.org/onyxframework/http)\n[![Docs](https://img.shields.io/badge/docs-online-brightgreen.svg?style=flat-square)](https://docs.onyxframework.org/http)\n[![API docs](https://img.shields.io/badge/api_docs-online-brightgreen.svg?style=flat-square)](https://api.onyxframework.org/http)\n[![Latest release](https://img.shields.io/github/release/onyxframework/http.svg?style=flat-square)](https://github.com/onyxframework/http/releases)\n\nAn opinionated framework for scalable web.\n\n## About 👋\n\nOnyx::HTTP is an opinionated HTTP framework for [Crystal language](https://crystal-lang.org/). It features DSL and modules to build modern, scalabale web applications with first-class support for websockets.\n\n## Installation 📥\n\nAdd these lines to your application's `shard.yml`:\n\n```yaml\ndependencies:\n  onyx:\n    github: onyxframework/onyx\n    version: ~\u003e 0.6.0\n  onyx-http:\n    github: onyxframework/http\n    version: ~\u003e 0.9.0\n```\n\nThis shard follows [Semantic Versioning v2.0.0](http://semver.org/), so check [releases](https://github.com/onyxframework/http/releases) and change the `version` accordingly.\n\n\u003e Note that until Crystal is officially released, this shard would be in beta state (`0.*.*`), with every **minor** release considered breaking. For example, `0.1.0` → `0.2.0` is breaking and `0.1.0` → `0.1.1` is not.\n\n## Usage 💻\n\nThe simplest hello world:\n\n```crystal\nrequire \"onyx/http\"\n\nOnyx::HTTP.get \"/\" do |env|\n  env.response \u003c\u003c \"Hello, world!\"\nend\n\nOnyx::HTTP.listen\n```\n\nEncapsulated endpoints:\n\n```crystal\nstruct GetUser\n  include Onyx::HTTP::Endpoint\n\n  params do\n    path do\n      type id : Int32\n    end\n  end\n\n  errors do\n    type UserNotFound(404)\n  end\n\n  def call\n    user = Onyx::SQL.query(User.where(id: params.path.id)).first? # This code is part of onyx/sql\n    raise UserNotFound.new unless user\n\n    return UserView.new(user)\n  end\nend\n\nOnyx::HTTP.get \"/users/:id\", GetUser\n```\n\nEncapsulated views:\n\n```crystal\nstruct UserView\n  include Onyx::HTTP::View\n\n  def initialize(@user : User)\n  end\n\n  json id: @user.id, name: @user.name\nend\n```\n\nWebsocket channels:\n\n```crystal\nstruct Echo\n  include Onyx::HTTP::Channel\n\n  def on_message(message)\n    socket.send(message)\n  end\nend\n\nOnyx::HTTP.ws \"/\", Echo\n```\n\n## Documentation 📚\n\nThe documentation is available online at [docs.onyxframework.org/http](https://docs.onyxframework.org/http).\n\n## Community 🍪\n\nThere are multiple places to talk about Onyx:\n\n* [Gitter](https://gitter.im/onyxframework)\n* [Twitter](https://twitter.com/onyxframework)\n\n## Support ❤️\n\nThis shard is maintained by me, [Vlad Faust](https://vladfaust.com), a passionate developer with years of programming and product experience. I love creating Open-Source and I want to be able to work full-time on Open-Source projects.\n\nI will do my best to answer your questions in the free communication channels above, but if you want prioritized support, then please consider becoming my patron. Your issues will be labeled with your patronage status, and if you have a sponsor tier, then you and your team be able to communicate with me privately in [Twist](https://twist.com). There are other perks to consider, so please, don't hesistate to check my Patreon page:\n\n\u003ca href=\"https://www.patreon.com/vladfaust\"\u003e\u003cimg height=\"50\" src=\"https://onyxframework.org/img/patreon-button.svg\"\u003e\u003c/a\u003e\n\nYou could also help me a lot if you leave a star to this GitHub repository and spread the word about Crystal and Onyx! 📣\n\n## Contributing\n\n1. Fork it ( https://github.com/onyxframework/http/fork )\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'feat: some feature') using [Angular style commits](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit)\n4. Push to the branch (git push origin my-new-feature)\n5. Create a new Pull Request\n\n## Contributors\n\n- [Vlad Faust](https://github.com/vladfaust) - creator and maintainer\n\n## Licensing\n\nThis software is licensed under [MIT License](LICENSE).\n\n[![Open Source Initiative](https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Opensource.svg/100px-Opensource.svg.png)](https://opensource.org/licenses/MIT)\n","funding_links":["https://www.patreon.com/vladfaust"],"categories":["Web Frameworks","Crystal"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonyxframework%2Fhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fonyxframework%2Fhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fonyxframework%2Fhttp/lists"}