-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.ru
More file actions
executable file
·49 lines (36 loc) · 1.04 KB
/
config.ru
File metadata and controls
executable file
·49 lines (36 loc) · 1.04 KB
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
48
49
#!/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
# Serve static files from "public" directory:
use Utopia::Static, root: "public"
use Utopia::Redirection::Rewrite, {
"/" => "/welcome/index"
}
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
# Serve static files from "pages" directory:
use Utopia::Static
# Serve dynamic content:
use Utopia::Content
run lambda {|env| [404, {}, []]}