Skip to content

Instantly share code, notes, and snippets.

@mig-hub
mig-hub / chat.rb
Last active March 28, 2020 16:56 — forked from rkh/chat.rb
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do