Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
21 lines (16 sloc) 368 Bytes
require 'sinatra'
require 'json'
@@shouts = ["inaugural wassap"]
get '/app.js' do
coffee File.read('app.js.coffee')
end
get '/' do
File.read('app.html')
end
post '/events' do
content_type :json
if params["message"]["cmd"] == "shout"
@@shouts = @@shouts.unshift params["message"]["text"]
end
{:shouts => @@shouts.map{|s| {:shout => s}}}.to_json
end
Something went wrong with that request. Please try again.