Skip to content

Commit

Permalink
Allow specifying the URL base when running standalone
Browse files Browse the repository at this point in the history
You can specify the URL base using the BEANSTALKD_VIEW_PATH
environment variable (default: '/').
  • Loading branch information
fotos committed Feb 27, 2015
1 parent 8d9310d commit 023b40b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bin/beanstalkd_view
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ end
require 'beanstalkd_view'

ENV['BEANSTALK_URL'] ||= 'beanstalk://localhost/'
ENV['BEANSTALKD_VIEW_PATH'] ||= '/'

Vegas::Runner.new(BeanstalkdView::Server, 'Beanstalkd View')
Vegas::Runner.new(Rack::URLMap.new(ENV['BEANSTALKD_VIEW_PATH'] => BeanstalkdView::Server), 'Beanstalkd View')
6 changes: 5 additions & 1 deletion config.ru
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ $LOAD_PATH.unshift File.expand_path(File.dirname(__FILE__) + '/lib')
ENV['BEANSTALK_URL'] ||= 'beanstalk://localhost/'
#ENV['BEANSTALK_URL'] ||= 'beanstalk://localhost:11300,beanstalk://localhost:11400'

ENV['BEANSTALKD_VIEW_PATH'] ||= '/'

# config.ru
require 'beanstalkd_view'
run BeanstalkdView::Server
run Rack::URLMap.new(
ENV['BEANSTALKD_VIEW_PATH'] => BeanstalkdView::Server
)

0 comments on commit 023b40b

Please sign in to comment.