Skip to content

Commit e74c2db

Browse files
committed
Merge pull request reactjs#119 from allcentury/ruby-default
nil is false in ruby
2 parents e50157d + 46a9a9a commit e74c2db

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
require 'webrick'
1212
require 'json'
1313

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

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

0 commit comments

Comments
 (0)