Skip to content

Instantly share code, notes, and snippets.

@saga
Created November 25, 2010 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saga/715632 to your computer and use it in GitHub Desktop.
Save saga/715632 to your computer and use it in GitHub Desktop.
module(..., package.seeall)
-- Source: http://keplerproject.github.com/wsapi/manual.html
function run(wsapi_env)
local headers = { ["Content-type"] = "text/html" }
local function hello_text()
local testStr = "aabb"
local testStr2 = "ccdd"
local result = ""
for i=1, 10000 do
result = result .. testStr
result = result .. testStr2
end
coroutine.yield("<html><body>")
coroutine.yield("<p>Hello Wsapi!</p>")
coroutine.yield("<p>PATH_INFO: " .. wsapi_env.PATH_INFO .. "</p>")
coroutine.yield("<p>SCRIPT_NAME: " .. wsapi_env.SCRIPT_NAME .. "</p>")
coroutine.yield("<br/>" .. result)
coroutine.yield("</body></html>")
end
return 200, headers, coroutine.wrap(hello_text)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment