Sha256: 22fd4215114a828818119cc26019d7c9b8cd9bc4a93b7d99b9b3847aefcd0ff7

Contents?: true

Size: 635 Bytes

Versions: 8

Compression:

Stored size: 635 Bytes

Contents

# encoding: utf-8
require 'sinatra'
require 'json'
require 'yaml'
require 'erb'
require 'aws-sdk'
require 'openssl'
require 'net/ssh'
require 'peach'

class GaptoolServer < Sinatra::Application
  enable :sessions
  disable :show_exceptions
  enable :raise_errors

  before do
    error 401 unless $redis.hget('users', env['HTTP_X_GAPTOOL_USER']) == env['HTTP_X_GAPTOOL_KEY']
    error 401 unless env['HTTP_X_GAPTOOL_USER'] && env['HTTP_X_GAPTOOL_KEY']
  end

  helpers do
    include Rack::Utils
    alias_method :h, :escape_html
  end
end

require_relative 'helpers/init'
require_relative 'models/init'
require_relative 'routes/init'

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gaptool-server-0.3.3 lib/app.rb
gaptool-server-0.3.2 lib/app.rb
gaptool-server-0.3.1 lib/app.rb
gaptool-server-0.3.0 lib/app.rb
gaptool-server-0.2.4 lib/app.rb
gaptool-server-0.2.3 lib/app.rb
gaptool-server-0.2.1 lib/app.rb
gaptool-server-0.2.0 lib/app.rb