Sha256: 3e3eb9f71dd6563e67d2d73e6367c0221c03b02a75237e3ce3073c67486515df

Contents?: true

Size: 913 Bytes

Versions: 5

Compression:

Stored size: 913 Bytes

Contents

#!/usr/bin/env rackup
# frozen_string_literal: true

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 Rack::Sendfile

use Utopia::Redirection::Rewrite,
	'/' => '/wiki/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']

use Utopia::Controller

use Utopia::Static

# Serve dynamic content
use Utopia::Content

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
utopia-2.12.4 documentation/config.ru
utopia-2.12.3 documentation/config.ru
utopia-2.12.2 documentation/config.ru
utopia-2.12.1 documentation/config.ru
utopia-2.12.0 documentation/config.ru