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