Sha256: 802ad56e7903f7b2b265abef96fba159c54fc9a8d397778bcf137ec06f21e159

Contents?: true

Size: 1.21 KB

Versions: 18

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env rackup

require_relative 'config/environment'

if RACK_ENV == :production
	# Handle exceptions in production with a error page and send an email notification:
	use Utopia::Exceptions::Handler
	use Utopia::Exceptions::Mailer
else
	# We want to propate exceptions up when running tests:
	use Rack::ShowExceptions unless RACK_ENV == :test
	
	# Serve the public directory in a similar way to the web server:
	use Utopia::Static, root: 'public'
end

use Rack::Sendfile

use Utopia::ContentLength

use Utopia::Redirection::Rewrite,
	'/' => '/welcome/index'

use Utopia::Redirection::DirectoryIndex

use Utopia::Redirection::Errors,
	404 => '/errors/file-not-found'

use Utopia::Localization,
	:default_locale => 'en',
	:locales => ['en', 'de', 'ja', 'zh'],
	:nonlocalized => ['/_static/', '/_cache/']

use Utopia::Controller,
	cache_controllers: (RACK_ENV == :production),
	base: Utopia::Controller::Base

use Utopia::Static

# Serve dynamic content
use Utopia::Content,
	cache_templates: (RACK_ENV == :production),
	tags: {
		'deferred' => Utopia::Tags::Deferred,
		'override' => Utopia::Tags::Override,
		'node' => Utopia::Tags::Node,
		'environment' => Utopia::Tags::Environment.for(RACK_ENV)
	}

run lambda { |env| [404, {}, []] }

Version data entries

18 entries across 15 versions & 1 rubygems

Version Path
utopia-1.9.11 documentation/config.ru
utopia-1.9.10 documentation/config.ru
utopia-1.9.9 documentation/config.ru
utopia-1.9.7 documentation/config.ru
utopia-1.9.6 documentation/config.ru
utopia-1.9.5 documentation/config.ru
utopia-1.9.4 documentation/config.ru
utopia-1.9.3 documentation/config.ru
utopia-1.9.2 documentation/config.ru
utopia-1.9.2 setup/site/config.ru
utopia-1.9.1 documentation/config.ru
utopia-1.9.1 setup/site/config.ru
utopia-1.9.0 setup/site/config.ru
utopia-1.9.0 documentation/config.ru
utopia-1.8.3 setup/site/config.ru
utopia-1.8.2 setup/site/config.ru
utopia-1.8.1 setup/site/config.ru
utopia-1.8.0 setup/site/config.ru