aboutsummaryrefslogtreecommitdiff
path: root/www/cgi-bin/test.lua
diff options
context:
space:
mode:
Diffstat (limited to 'www/cgi-bin/test.lua')
-rwxr-xr-xwww/cgi-bin/test.lua43
1 files changed, 0 insertions, 43 deletions
diff --git a/www/cgi-bin/test.lua b/www/cgi-bin/test.lua
deleted file mode 100755
index c86b3f5..0000000
--- a/www/cgi-bin/test.lua
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env luajit
-
-local cgi = require("cgi")
-local req_params = require("req-params")
-local str=""
-
-if req_params.param("password") and req_params.param("password") == "401" then
- cgi.render("401 Unauthorized",{["Content-Type"]="text/html"},401)
- return
-end
-
--- Access GET parameters
-if next(req_params.get_params) then
- str=str..m("h2","GET parameters:")
- for k,v in pairs(req_params.get_params) do
- str=str..k.." = "..v.."<br>"
- end
-end
-
--- Access POST parameters
-if next(req_params.post_params) then
- str=str..m("h2","POST parameters:")
- for k,v in pairs(req_params.post_params) do
- str=str..k.." = "..v.."<br>"
- end
-end
-
--- Combined helper
-local name = req_params.param("name") or "anonymous"
-str=str..m("p","Hello, "..name.."!")
-
-cgi.render(m("html",
- m("head",
- m("title","ssg test")
- )..
- m("body",
- m("h1","Hello from Lua CGI")..
- m("p", "ssg test")..
- m("p",_VERSION)..
- str
- )
-),
-{["Content-Type"]="text/html"},200) \ No newline at end of file