wsapi.cgi Man page

wsapi.cgi(1) wsapi documentation wsapi.cgi(1)

NAME

wsapi.cgi – cgi wrapper for wsapi based dynamic pages

SYNOPSIS

#!/usr/bin/env wsapi.cgi

DESCRIPTION

A sample dynamic page follows:

#!/usr/bin/env wsapi.cgi

module(…, package.seeall)

function run(wsapi_env)
local headers = { [“Content-type”] = “text/html” }

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(““)
end

return 200, headers, coroutine.wrap(hello_text)
end

SEE ALSO

wsapi.fcgi(1)

AUTHOR

Enrico Tassi

28 April 2009 wsapi.cgi(1)