-
-
Save jonasporto/1acbedff01480b492e7cf940bb4728fa to your computer and use it in GitHub Desktop.
Thin with SSL as default server for use with rails server. Works with Rubymine.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rack' | |
# Thin SSL workaround | |
module Rack | |
module Handler | |
class Thin | |
def self.run(app, options={}) | |
app = Rack::Chunked.new(Rack::ContentLength.new(app)) | |
server = ::Thin::Server.new(options[:Host] || '0.0.0.0', | |
options[:Port] || 3000, | |
app) | |
server.ssl = true | |
server.ssl_options = { | |
:private_key_file => SERVER_KEY, | |
:cert_chain_file => SERVER_PEM | |
} | |
yield server if block_given? | |
server.start | |
end | |
end | |
end | |
end | |
# Workaround end | |
APP_PATH = File.expand_path('../../config/application', __FILE__) | |
require_relative '../config/boot' | |
require 'rails/commands' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment