Search code examples
rubysslsinatrawebrickpadrino

How do you set the WEBRick options parameter in the run method with Padrino


I don't want to monkey patch Padrino.

I still want to be able to use the command padrino start -d from the command line.

I want to get SSL up and running within padrino. Within Sinatra I just do:

Rack::Handler::WEBrick.run MyServer, MyServerOptionsWithAppropriateSSLStuffEtc

I found the file deep inside the Padrino core that handles setting these options, but I really don't want to monkey patch the application.

Ideally I'd like there to be be some way I could set the options within my Padrino::Application subclass.

So far I haven't found any documentation on how to do this, or if this is even possible.


Solution

  • mmm, you should be able to do the same.

    In your project folder you should see config.ru

    Try to edit it removing last line with:

    Rack::Handler::WEBrick.run Padrino.application, MyServerOptionsWithAppropriateSSLStuff
    

    Then from command line:

    $ rackup