Sha256: 11d8c7407ced63bcae44b1da4421e3348835945aa6608782320a588b506f6691

Contents?: true

Size: 987 Bytes

Versions: 9

Compression:

Stored size: 987 Bytes

Contents

#!/usr/bin/env rackup

require_relative 'config/environment'

require 'rack/freeze'

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 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']

require 'utopia/session'
use Utopia::Session,
	expires_after: 3600 * 24,
	secret: ENV['UTOPIA_SESSION_SECRET'],
	secure: true

use Utopia::Controller

use Utopia::Static

# Serve dynamic content
use Utopia::Content

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
utopia-2.9.0 setup/site/config.ru
utopia-2.8.2 setup/site/config.ru
utopia-2.8.1 setup/site/config.ru
utopia-2.8.0 setup/site/config.ru
utopia-2.7.0 setup/site/config.ru
utopia-2.6.0 setup/site/config.ru
utopia-2.5.5 setup/site/config.ru
utopia-2.5.4 setup/site/config.ru
utopia-2.5.3 setup/site/config.ru