Skip to content

Commit abc339d

Browse files
committed
store plaintext response
1 parent c711a62 commit abc339d

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

frameworks/Luau/lute/src/serve.luau

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
local net = require("@lute/net")
22
local json = require("./json")
33

4+
local plaintext = {
5+
status = 200,
6+
headers = {
7+
["Content-Type"] = "text/plain",
8+
["Server"] = "Lute",
9+
},
10+
body = "Hello, world!",
11+
}
12+
413
return {
514
serve = function()
615
net.serve(function(req)
716
if req.path == "/plaintext" then
8-
return {
9-
status = 200,
10-
headers = {
11-
["Content-Type"] = "text/plain",
12-
["Server"] = "Lute",
13-
},
14-
body = "Hello, world!",
15-
}
17+
return plaintext
1618
elseif req.path == "/json" then
1719
return {
1820
status = 200,

0 commit comments

Comments
 (0)