~lastrosade/getcraft

e89a47a285e98aeb5943203ae0b7b178e9cc7c4e — jeremy.shields 5 years ago 7e67136
src
1 files changed, 11 insertions(+), 0 deletions(-)

A src/index.lua
A src/index.lua => src/index.lua +11 -0
@@ 0,0 1,11 @@
local http = require('http')

http.createServer(function (req, res)
	local body = "Hello world\n"
	res:setHeader("Content-Type", "text/plain")
	res:setHeader("Content-Length", #body)
	res:setHeader("Location", "nice")
	res:finish(body)
end):listen(1337, '127.0.0.1')

print('Server running at http://127.0.0.1:1337/')