0

I have a grape application and I'd like to modify the port WEBrick starts on, can anybody point me in the right direction...

require './api/api.rb'

use Rack::Session::Cookie
run Rack::Cascade.new [API]
Jacob Clark
  • 3,317
  • 5
  • 32
  • 61

2 Answers2

0

Looks like the run method takes a Port parameter. All you must do is pass it the port, so:

run Rack::Cascade.new [API], :Port => 58080

Hope that helps... If you've further problems, do leave a comment.

hd1
  • 33,938
  • 5
  • 80
  • 91
  • This didn't seem to work, any ideas? [2014-08-24 22:00:19] INFO WEBrick::HTTPServer#start: pid=9774 port=9292 – Jacob Clark Aug 24 '14 at 22:02
  • wont work, as Cascade doesn't accept parameters like this https://github.com/rack/rack/blob/master/lib/rack/cascade.rb – equivalent8 Oct 07 '14 at 13:06
0

if you just want to explicitly run it on Webrick, one solution might be:

webrick_options = {
  :Port               => 9393,
  :Logger             => WEBrick::Log::new($stderr, WEBrick::Log::DEBUG),
}

Rack::Handler::WEBrick.run(API, webrick_options)

However if you need Cascade (multiple apps) I didn't figure that one out yet.

equivalent8
  • 13,754
  • 8
  • 81
  • 109