mirror of
https://github.com/danbee/scoreboard
synced 2025-03-04 08:59:11 +00:00
First commit.
This commit is contained in:
commit
96ca60e6fa
3
.env.example
Normal file
3
.env.example
Normal file
@ -0,0 +1,3 @@
|
||||
PUSHER_KEY=
|
||||
PUSHER_SECRET=
|
||||
PUSHER_APP=
|
||||
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.env
|
||||
6
Gemfile
Normal file
6
Gemfile
Normal file
@ -0,0 +1,6 @@
|
||||
source 'https://rubygems.org'
|
||||
|
||||
gem 'dotenv'
|
||||
|
||||
gem 'sinatra'
|
||||
gem 'pusher'
|
||||
25
Gemfile.lock
Normal file
25
Gemfile.lock
Normal file
@ -0,0 +1,25 @@
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
httpclient (2.6.0.1)
|
||||
multi_json (1.11.0)
|
||||
pusher (0.14.4)
|
||||
httpclient (~> 2.5)
|
||||
multi_json (~> 1.0)
|
||||
signature (~> 0.1.8)
|
||||
rack (1.6.0)
|
||||
rack-protection (1.5.3)
|
||||
rack
|
||||
signature (0.1.8)
|
||||
sinatra (1.4.6)
|
||||
rack (~> 1.4)
|
||||
rack-protection (~> 1.4)
|
||||
tilt (>= 1.3, < 3)
|
||||
tilt (1.4.1)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
pusher
|
||||
sinatra
|
||||
21
scores.rb
Executable file
21
scores.rb
Executable file
@ -0,0 +1,21 @@
|
||||
#!/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
|
||||
Loading…
Reference in New Issue
Block a user