Sha256: a12102907c2ee18f0a5a8b3c69d598348a88117efe675b857920908c79011709

Contents?: true

Size: 1.02 KB

Versions: 21

Compression:

Stored size: 1.02 KB

Contents

# FIXME: Newrelic agent bug: we have to define the logfile early
Conf.prepare_newrelic

# Load code
Conf.log :rackup, "load project code"

load_path_libs = File.expand_path "lib", File.dirname(__FILE__)
$LOAD_PATH.unshift(load_path_libs) unless $LOAD_PATH.include?(load_path_libs)
require "rest-ftp-daemon"

# Rack authent
Conf.log :rackup, "authentication, assets, env-specific"
unless Conf[:adminpwd].nil?
  use Rack::Auth::Basic, "Restricted Area" do |username, password|
    [username, password] == ["admin", Conf[:adminpwd]]
  end
end

# Serve static assets
use Rack::Static, root: "#{Conf.app_libs}/static/", urls: [
  "/css/",
  "/js/",
  "/fonts/",
  "/images/",
  "/swagger/",
  MOUNT_SWAGGER_UI,
  ]

# Env-specific configuration
case Conf.app_env
  when "development"
    # Rack reloader
    use Rack::Reloader, 1

    # Newrelic dev mode
    require 'new_relic/rack/developer_mode'
    use NewRelic::Rack::DeveloperMode

  when "production"
end

# Launch the API
Conf.log :rackup, "start API::Root"
run RestFtpDaemon::API::Root

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rest-ftp-daemon-1.1.1 config.ru
rest-ftp-daemon-1.1.0 config.ru
rest-ftp-daemon-1.0.15 config.ru
rest-ftp-daemon-1.0.14 config.ru
rest-ftp-daemon-1.0.13 config.ru
rest-ftp-daemon-1.0.12 config.ru
rest-ftp-daemon-1.0.11 config.ru
rest-ftp-daemon-1.0.10 config.ru
rest-ftp-daemon-1.0.9 config.ru
rest-ftp-daemon-1.0.8 config.ru
rest-ftp-daemon-1.0.7 config.ru
rest-ftp-daemon-1.0.6 config.ru
rest-ftp-daemon-1.0.5 config.ru
rest-ftp-daemon-1.0.4 config.ru
rest-ftp-daemon-1.0.3 config.ru
rest-ftp-daemon-1.0.2 config.ru
rest-ftp-daemon-1.0.1 config.ru
rest-ftp-daemon-0.502.2 config.ru
rest-ftp-daemon-0.502.1 config.ru
rest-ftp-daemon-0.502.0 config.ru