Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

nil is false in ruby #119

Merged
merged 1 commit into from
Jan 24, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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