Sha256: 4f13ce57b8e5ca80e6c6cf7a7cfda7705fb39acca6b37eb7eed67c412e76c943

Contents?: true

Size: 1.88 KB

Versions: 1

Compression:

Stored size: 1.88 KB

Contents

### Copyright 2016 Pixar
###
###    Licensed under the Apache License, Version 2.0 (the "Apache License")
###    with the following modification; you may not use this file except in
###    compliance with the Apache License and the following modification to it:
###    Section 6. Trademarks. is deleted and replaced with:
###
###    6. Trademarks. This License does not grant permission to use the trade
###       names, trademarks, service marks, or product names of the Licensor
###       and its affiliates, except as required to comply with Section 4(c) of
###       the License and to reproduce the content of the NOTICE file.
###
###    You may obtain a copy of the Apache License at
###
###        http://www.apache.org/licenses/LICENSE-2.0
###
###    Unless required by applicable law or agreed to in writing, software
###    distributed under the Apache License with the above modification is
###    distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
###    KIND, either express or implied. See the Apache License for the specific
###    language governing permissions and limitations under the Apache License.
###
###

module JSSWebHooks

  # Sinatra Server
  class Server < Sinatra::Base

    DEFAULT_SERVER_ENGINE = :webrick
    DEFAULT_PORT = 8443

    configure do
      server_engine = JSSWebHooks::CONFIG.server_engine || DEFAULT_SERVER_ENGINE
      server_port = JSSWebHooks::CONFIG.server_port || DEFAULT_PORT

      set :bind, '0.0.0.0'
      set :server, server_engine
      set :port, server_port
    end

    # run the server doing any engine-based config along the way
    def self.run!
      super do |server|
        case server
        when WEBrick::HTTPServer
          webrick_ssl_config server
        end # case
      end # do server
    end # run!

    def self.webrick_ssl_config(_server)
      # TODO: add ssl config
      true
    end

  end # class

end # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-jss-0.6.6 lib/jss/webhooks/server_app/server.rb