Skip to content

Commit

Permalink
use less common environment variables for configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stve committed Nov 11, 2011
1 parent 888adb6 commit 22c378b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ require 'pow_proxy'
run PowProxy.new(:host => '127.0.0.1', :port => 8080) run PowProxy.new(:host => '127.0.0.1', :port => 8080)
``` ```


You can also set the host and port by exporting the `HOST` and `PORT` environment variables in your `.powenv`. You can also set the host and port by exporting the `POW_PROXY_HOST` and `POW_PROXY_PORT` environment variables in your `.powenv`.


Make sure your node app is running, symlink your app so that Pow knows about it and you'll be all set. Make sure your node app is running, symlink your app so that Pow knows about it and you'll be all set.


Expand Down
4 changes: 2 additions & 2 deletions lib/pow_proxy.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class PowProxy
attr_reader :host, :port attr_reader :host, :port


def initialize(options = {}) def initialize(options = {})
@host = options.delete(:host) || ENV['HOST'] || DEFAULT_HOST @host = options.delete(:host) || ENV['POW_PROXY_HOST'] || DEFAULT_HOST
@port = options.delete(:port) || ENV['PORT'] || DEFAULT_PORT @port = options.delete(:port) || ENV['POW_PROXY_PORT'] || DEFAULT_PORT
end end


def call(env) def call(env)
Expand Down
4 changes: 2 additions & 2 deletions spec/pow_proxy_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@


context 'ENV' do context 'ENV' do
before do before do
ENV['HOST'] = 'monk.local' ENV['POW_PROXY_HOST'] = 'monk.local'
ENV['PORT'] = '8080' ENV['POW_PROXY_PORT'] = '8080'
@proxy = PowProxy.new @proxy = PowProxy.new
end end


Expand Down

0 comments on commit 22c378b

Please sign in to comment.