about summary refs log tree commit diff stats
path: root/lua
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2024-06-05 22:34:13 -0400
committerelioat <elioat@tilde.institute>2024-06-05 22:34:13 -0400
commiteef5ab306a9a5d2fee1c9828980b118184f530ac (patch)
treee71ae10b09c9e8c5996fc2df1caeacd236d75173 /lua
parentc5b5258160e96a16ba11d48d306c5c26c13ee0e7 (diff)
downloadtour-eef5ab306a9a5d2fee1c9828980b118184f530ac.tar.gz
teapot
Diffstat (limited to 'lua')
-rw-r--r--lua/sandborb/route_handler.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/lua/sandborb/route_handler.lua b/lua/sandborb/route_handler.lua
index 7819d3d..77ec7f4 100644
--- a/lua/sandborb/route_handler.lua
+++ b/lua/sandborb/route_handler.lua
@@ -22,6 +22,15 @@ local function gib(e,n)
   }
 end
 
+local function teapot(e)
+  return {
+    code = 418,
+    status = "I'm a teapot",
+    content_type = "text/html, charset=utf-8",
+    body = "<h1>I'm a teapot!</h1>"
+  }
+end
+
 local function error_404(e, p)
   return {
     code = 404,
@@ -49,6 +58,8 @@ function HANDLE_ROUTE(e, path)
     math.randomseed(os.time())
     local number_of_words = math.random(2, 10)
     response = gib(e, number_of_words)
+  elseif path == "/teapot" then
+    response = teapot(e)
   else
     response = error_404(e, path)
   end
-0400 committer Ben Morrison <ben@gbmor.dev> 2019-05-12 23:36:04 -0400 reorganized handlers. StrictSlash(true). handling POST /api/plain/users for new users' href='/gbmor/getwtxt/commit/main.go?h=v0.2.0&id=d2680fb62bac6c779f371b2b6839592274a8d281'>d2680fb ^
c87acad ^

d2680fb ^


efa99ed ^
d6fbc25 ^


efa99ed ^
d2680fb ^


efa99ed ^
5310d08 ^

d2680fb ^


efa99ed ^
5310d08 ^

bd2800a ^
d2680fb ^
5310d08 ^
efa99ed ^
5310d08 ^


d2680fb ^
5310d08 ^
bd2800a ^
efa99ed ^
37bf8b0 ^

d2680fb ^
dfab6f2 ^
d2680fb ^
d2680fb ^
efa99ed ^
37bf8b0 ^













d437b89 ^
d2680fb ^


efa99ed ^
711012e ^
dfab6f2 ^
d2680fb ^

fb63b07 ^
cd635e6 ^


711012e ^
bd5e602 ^

c87acad ^
747f4fb ^
06cffd8 ^
c87acad ^


893123c ^
bd23ef0 ^
c87acad ^



bd5e602 ^
d083ce6 ^
893123c ^
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104