mirror of
https://github.com/lune-org/lune.git
synced 2024-12-12 13:00:37 +00:00
20 lines
420 B
Lua
20 lines
420 B
Lua
local RESPONSE = "Hello, lune!"
|
|
|
|
task.spawn(function()
|
|
net.serve(8080, function(request)
|
|
-- info("Request:", request)
|
|
-- info("Responding with", RESPONSE)
|
|
return RESPONSE
|
|
end)
|
|
end)
|
|
|
|
local response = net.request("http://127.0.0.1:8080").body
|
|
assert(response == RESPONSE, "Invalid response from server")
|
|
|
|
task.delay(1, function()
|
|
process.exit(0)
|
|
end)
|
|
|
|
task.delay(2, function()
|
|
error("Process did not exit")
|
|
end)
|