mirror of
https://github.com/danbee/scoreboard
synced 2025-03-04 08:59:11 +00:00
22 lines
424 B
Ruby
Executable File
22 lines
424 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']}"
|
|
|
|
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
|