How to make Sinatra work over HTTPS/SSL?

后端 未结 5 1622
闹比i
闹比i 2020-11-30 21:40

As the title says, Google doesn\'t give anything useful concerning this.

How do I set up and configure HTTPS/SSL for Sinatra apps?

How do I create a HTTPS ro

5条回答
  •  攒了一身酷
    2020-11-30 22:02

    I think using rack-ssl is the best option.

    Then you just do:

    class Application < Sinatra::Base
      use Rack::SSL
    
      get '/' do
        'SSL FTW!'
      end
    end
    

    and all http:// calls are redirected to https://

提交回复
热议问题