Sha256: c061a2e669b4c170782ea288a9a0ade32ff1d24b9c6c72033a3a336d7bae8ac3

Contents?: true

Size: 911 Bytes

Versions: 11

Compression:

Stored size: 911 Bytes

Contents

#!/usr/bin/env ruby
old_verbose, $VERBOSE = $VERBOSE, nil
begin
  require File.expand_path('../../test/live_server', __FILE__)
ensure
  $VERBOSE = old_verbose
end
require 'webrick'

port = 4000
if found = ARGV.index('-p')
  port = ARGV[found + 1].to_i
end

log_io = $stdout
log_io.sync = true

webrick_opts = {
  :Port => port, :Logger => WEBrick::Log::new(log_io),
  :AccessLog => [[log_io, "[%{X-Faraday-Adapter}i] %m  %U  ->  %s %b"]]
}

if ENV['SSL_KEY']
  require 'openssl'
  require 'webrick/https'
  webrick_opts.update \
    :SSLEnable       => true,
    :SSLPrivateKey   => OpenSSL::PKey::RSA.new(File.read(ENV['SSL_KEY'])),
    :SSLCertificate  => OpenSSL::X509::Certificate.new(File.read(ENV['SSL_FILE'])),
    :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE
end

Rack::Handler::WEBrick.run(Faraday::LiveServer, webrick_opts) do |server|
  trap(:INT)  { server.stop }
  trap(:TERM) { server.stop }
end

Version data entries

11 entries across 11 versions & 3 rubygems

Version Path
faraday-0.8.11 script/server
faraday-0.8.10 script/server
faraday-0.9.1 script/server
vagrant-tiktalik-0.0.3 vendor/bundle/ruby/2.0.0/gems/faraday-0.8.9/script/server
whos_dated_who-0.1.0 vendor/bundle/gems/faraday-0.9.0/script/server
whos_dated_who-0.0.1 vendor/bundle/gems/faraday-0.9.0/script/server
faraday-0.9.0 script/server
faraday-0.9.0.rc7 script/server
faraday-0.8.9 script/server
faraday-0.9.0.rc6 script/server
faraday-0.8.8 script/server