Sha256: f76b68f675336fcc80f2eb4543b5eb5163238e3145b6b005c9c50c9ecbd106b6

Contents?: true

Size: 1.23 KB

Versions: 5

Compression:

Stored size: 1.23 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/', '/_components/']

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

5 entries across 5 versions & 1 rubygems

Version Path
utopia-1.9.7 setup/site/config.ru
utopia-1.9.6 setup/site/config.ru
utopia-1.9.5 setup/site/config.ru
utopia-1.9.4 setup/site/config.ru
utopia-1.9.3 setup/site/config.ru