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]
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]
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.
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.