From 7e6713666218495593420b8505f04591bfed5d3a Mon Sep 17 00:00:00 2001 From: "jeremy.shields" Date: Sun, 4 Nov 2018 13:18:02 +0100 Subject: [PATCH] Initial commit --- .gitignore | 4 ++++ getluvit.bat | 1 + getluvit.sh | 3 +++ index.lua | 11 +++++++++++ 4 files changed, 19 insertions(+) create mode 100644 .gitignore create mode 100644 getluvit.bat create mode 100644 getluvit.sh create mode 100644 index.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c119a1f --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +lit +luvi +luvit + diff --git a/getluvit.bat b/getluvit.bat new file mode 100644 index 0000000..1009d8c --- /dev/null +++ b/getluvit.bat @@ -0,0 +1 @@ +PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "[Net.ServicePointManager]::SecurityProtocol = 'Tls12'; iex ((new-object net.webclient).DownloadString('https://github.com/luvit/lit/raw/master/get-lit.ps1'))" diff --git a/getluvit.sh b/getluvit.sh new file mode 100644 index 0000000..ec24b9a --- /dev/null +++ b/getluvit.sh @@ -0,0 +1,3 @@ +#!/bin/sh +curl -L https://github.com/luvit/lit/raw/master/get-lit.sh | sh + diff --git a/index.lua b/index.lua new file mode 100644 index 0000000..769555c --- /dev/null +++ b/index.lua @@ -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/') -- 2.45.2