diff --git a/t/lua/basic.lua b/t/lua/basic.lua new file mode 100644 index 00000000..29cec7c1 --- /dev/null +++ b/t/lua/basic.lua @@ -0,0 +1,14 @@ +function hello(wsapi_env) + local headers = { ["Content-type"] = "text/html", ["set-cookie"] = {"foo=bar", "bar=baz"} } + local function hello_text() + coroutine.yield("") + coroutine.yield("

Hello Wsapi!

") + coroutine.yield("

PATH_INFO: " .. wsapi_env.PATH_INFO .. "

") + coroutine.yield("

SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "

") + coroutine.yield("

QUERY_STRING: " .. wsapi_env.QUERY_STRING .. "

") + coroutine.yield("") + end + return 200, headers, coroutine.wrap(hello_text) +end + +return hello