{"id":27698185,"url":"https://github.com/mark24code/sinatra-websocket-example","last_synced_at":"2025-09-02T11:37:13.105Z","repository":{"id":280949762,"uuid":"943706933","full_name":"Mark24Code/sinatra-websocket-example","owner":"Mark24Code","description":"Sinatra websocket example ( Ruby 3 + Puma + faye-websocket + Websocket DSL )","archived":false,"fork":false,"pushed_at":"2025-03-06T06:27:43.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T07:37:54.652Z","etag":null,"topics":["example","sinatra","websocket"],"latest_commit_sha":null,"homepage":"","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/Mark24Code.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-06T06:16:10.000Z","updated_at":"2025-03-06T06:27:46.000Z","dependencies_parsed_at":"2025-03-06T07:38:00.451Z","dependency_job_id":null,"html_url":"https://github.com/Mark24Code/sinatra-websocket-example","commit_stats":null,"previous_names":["mark24code/sinatra-websocket-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Fsinatra-websocket-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Fsinatra-websocket-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Fsinatra-websocket-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mark24Code%2Fsinatra-websocket-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mark24Code","download_url":"https://codeload.github.com/Mark24Code/sinatra-websocket-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250854477,"owners_count":21498240,"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":["example","sinatra","websocket"],"created_at":"2025-04-25T16:40:13.385Z","updated_at":"2025-04-25T16:40:14.506Z","avatar_url":"https://github.com/Mark24Code.png","language":"Ruby","readme":"# Sinatra WebSocket Example\n\nRuby 3.4.2\n\nSinatra + Puma + faye-websocket\n\nThis is an example project using Sinatra and Faye::WebSocket.\n\n## Run\n\nclone this repository and do follwings.\n```\n$ bundle install\n$ ruby server.rb\n```\n\n\n## Websocket DSL\n\n\n```ruby\nclass App \u003c Sinatra::Base\n\n  get \"/\" do\n    erb :index\n  end\n\n  websocket \"/ws\" do |connect|\n    connect.on(:open) do |event|\n      puts 'On Open'\n    end\n\n    connect.on(:message) do |msg|\n      connect.send(msg.data.reverse)  # Reverse and reply\n    end\n\n    connect.on(:close) do |event|\n      puts 'On Close'\n    end\n  end\nend\n\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark24code%2Fsinatra-websocket-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark24code%2Fsinatra-websocket-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark24code%2Fsinatra-websocket-example/lists"}