1
0
mirror of https://github.com/danbee/scoreboard synced 2025-03-04 08:59:11 +00:00
scoreboard/scores.rb
2015-05-08 16:34:49 +01:00

26 lines
453 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'dotenv'
Dotenv.load
require 'sinatra'
require 'pusher'
Pusher.url = "http://#{ENV['PUSHER_KEY']}:#{ENV['PUSHER_SECRET']}@api.pusherapp.com/apps/#{ENV['PUSHER_APP']}"
get '/' do
erb :index
end
put '/player1_scores' do
Pusher['scores'].trigger('player1_scores', {
message: 'Player 1 scores'
})
end
put '/player2_scores' do
Pusher['scores'].trigger('player2_scores', {
message: 'Player 2 scores'
})
end