Sha256: 82b6736b27ca8b8afd049818c6c679b372cae98290030b8433742dffe261b9ec

Contents?: true

Size: 960 Bytes

Versions: 2

Compression:

Stored size: 960 Bytes

Contents

# Load gem files
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

2 entries across 2 versions & 1 rubygems

Version Path
rest-ftp-daemon-0.435.0 config.ru
rest-ftp-daemon-0.434.0 config.ru