{"id":13879205,"url":"https://github.com/logux/logux-rack","last_synced_at":"2025-07-16T15:31:45.157Z","repository":{"id":35169081,"uuid":"212016104","full_name":"logux/logux-rack","owner":"logux","description":"Rack-based Logux integration engine","archived":true,"fork":false,"pushed_at":"2023-07-12T18:05:11.000Z","size":398,"stargazers_count":12,"open_issues_count":6,"forks_count":16,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-09T15:17:39.484Z","etag":null,"topics":["logux","rack","ruby"],"latest_commit_sha":null,"homepage":"https://logux.org/","language":"Ruby","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/logux.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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-10-01T05:01:16.000Z","updated_at":"2024-08-25T22:47:45.000Z","dependencies_parsed_at":"2024-11-24T08:31:11.897Z","dependency_job_id":"45f47adb-d076-48db-aedd-40768f2607c7","html_url":"https://github.com/logux/logux-rack","commit_stats":{"total_commits":270,"total_committers":15,"mean_commits":18.0,"dds":0.5111111111111111,"last_synced_commit":"8ae3a380864ad55db10097b3cf9483813447d274"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/logux/logux-rack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Flogux-rack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Flogux-rack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Flogux-rack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Flogux-rack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/logux","download_url":"https://codeload.github.com/logux/logux-rack/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/logux%2Flogux-rack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265521434,"owners_count":23781502,"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":["logux","rack","ruby"],"created_at":"2024-08-06T08:02:13.363Z","updated_at":"2025-07-16T15:31:44.877Z","avatar_url":"https://github.com/logux.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"\u003ca href=\"https://amplifr.com/?utm_source=logux-rack\"\u003e\n  \u003cimg width=\"100\" height=\"140\" align=\"right\"\n    alt=\"Sponsored by Amplifr\" src=\"https://amplifr-direct.s3-eu-west-1.amazonaws.com/social_images/image/37b580d9-3668-4005-8d5a-137de3a3e77c.png\" /\u003e\n\u003c/a\u003e\n\n# Logux::Rack\n\nThis gem provides Logux back-end protocol support for Rack-based applications, including Ruby on Rails. It enables [Logux Server integration](https://logux.io/guide/starting/proxy-server/) for full-duplex client-server communication.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'logux-rack'\n```\n\nAnd then execute:\n\n```bash\nbundle install\n```\n\n## Usage\n\nHere is a minimal Rack configuration to start new `Logux::Rack` server:\n\n```ruby\n# config.ru\nrequire 'logux/rack'\n\nrun Logux.application\n```\n\nNote that the HTTP response streaming depends on the web server used to serve the application. Use a server with streaming capability. [Puma](https://puma.io/), for instance:\n\n```bash\ngem install puma\n```\n\nStart the server:\n\n```bash\npuma config.ru\n```\n\nIt is possible to mount `Logux::Rack` server within an existing Rails application. First of all, you will need to configure Logux by defining a server address in an initializer. For example, `config/initializers/logux.rb`:\n\n```ruby\nLogux.configuration do |config|\n  config.logux_host = 'http://localhost:31338'\nend\n```\n\nMount `Logux::Rack` in routes:\n\n```ruby\nRails.application.routes.draw do\n  mount Logux::Rack::App =\u003e '/'\nend\n```\n\nAfter this, POST requests to `/logux` will be processed by `LoguxController`. You can redefine it or inherit from, if it necessary, for example, for implementing custom authorization flow.\n\nHere is another routing example for [Roda](https://github.com/jeremyevans/roda) application routing:\n\n```ruby\nclass MyApp \u003c Roda\n  route do |r|\n    r.is 'logux' { r.run Logux::Rack::App }\n  end\nend\n```\n\n[Hanami](https://hanamirb.org/) configuration example:\n\n```ruby\n# config/environment.rb\nHanami.configure do\n  mount Logux::Rack::App, at: '/'\nend\n```\n\n`Logux::Rack` can also be embedded into another Rack application using [Rack::Builder](https://www.rubydoc.info/gems/rack/Rack/Builder):\n\n```ruby\n# config.ru\nrequire 'logux/rack'\n\napp = Rack::Builder.new do\n  use Rack::CommonLogger\n  map '/logux' { run Logux::Rack::App }\n  # ...\nend\n\nrun app\n```\n\n`Logux::Rack` will try to find Action for the specific message from Logux Server. For example, for `project/rename` action, you should define `Action::Project` class, inherited from `Logux::Action` base class, and implement `rename` method.\n\nYou can execute `rake logux:actions` to get the list of available action types, or `rake logux:channels` to get the list of available channels. Use optional path parameter to limit the search scope: `rake logux:actions[lib/logux/actions]`\n\n## Development with Docker\n\nInstall gem dependencies:\n\n```bash\ndocker-compose run app bundle install\n```\n\nRun the specs:\n\n```bash\ndocker-compose run app bundle exec rspec\n```\n\nPerform [integration test](https://github.com/logux/backend-test):\n\n```bash\ncd test/app\nbundle exec rails db:reset \u0026\u0026 bundle exec rails server\n\n# Execute from another terminal:\ncd test\nyarn \u0026\u0026 npx @logux/backend-test http://server:3000/logux\n```\n\nRun Rubocop:\n\n```bash\ndocker-compose run app bundle exec rubocop\n```\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogux%2Flogux-rack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flogux%2Flogux-rack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flogux%2Flogux-rack/lists"}