-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfig.ru
executable file
·47 lines (34 loc) · 975 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env rackup
# frozen_string_literal: true
require_relative 'config/environment'
self.freeze_app
if UTOPIA.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 UTOPIA.testing?
end
use Utopia::Static, root: 'public'
use Utopia::Redirection::Rewrite, {
'/' => '/restricted-area'
}
use Utopia::Redirection::DirectoryIndex
use Utopia::Redirection::Errors, {
404 => '/errors/file-not-found'
}
require 'utopia/localization'
use Utopia::Localization,
default_locale: 'en',
locales: ['en', 'de', 'ja', 'zh']
require 'utopia/session'
use Utopia::Session,
expires_after: 3600 * 24,
secret: UTOPIA.secret_for(:session),
secure: true
use Utopia::Controller
use Utopia::Static
# Serve dynamic content
use Utopia::Content
run lambda { |env| [404, {}, []] }