Skip to content

Commit

Permalink
Merge pull request reactjs#119 from allcentury/ruby-default
Browse files Browse the repository at this point in the history
nil is false in ruby
  • Loading branch information
zpao committed Jan 24, 2016
2 parents e50157d + 46a9a9a commit e74c2db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
require 'webrick'
require 'json'

port = ENV['PORT'].nil? ? 3000 : ENV['PORT'].to_i
# default port to 3000 or overwrite with PORT variable by running
# $ PORT=3001 ruby server.rb
port = ENV['PORT'] ? ENV['PORT'].to_i : 3000

puts "Server started: http://localhost:#{port}/"

Expand Down

0 comments on commit e74c2db

Please sign in to comment.