-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandler.rb
50 lines (43 loc) · 823 Bytes
/
handler.rb
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
require 'phlex'
def tos(event:, context:)
{
statusCode: 200,
headers: {
'Content-Type': 'text/html',
},
body: TosComponent.new.call
}
end
def privacy(event:, context:)
{
statusCode: 200,
headers: {
'Content-Type': 'text/html',
},
body: PrivacyComponent.new.call
}
end
class HeadComponent < Phlex::Component
def template
head do
script src: "https://cdn.tailwindcss.com"
end
end
end
class TosComponent < Phlex::Component
def template
render HeadComponent.new
body do
div class: "break-words px-6 py-12 text-left" do
h1 "Terms of Service", class: "text-5xl mb-7"
end
end
end
end
class PrivacyComponent < Phlex::Component
def template
body do
h1 "Privacy Policy", class: "text-5xl mb-7"
end
end
end