lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



On Oct 30, 2006, at 06:58, jason zhang wrote:

I want to embed the Lua into shttpd to run as a embeded web server.
Is there existing CGI library for Lua? If no, I have to write a simple
one by myself.

Just write your own like everyone else :P

#!/usr/local/bin/lua

local CGI = require( "CGI" )

local anHandler = function( aName )
        print( "Hello ", aName )
end

local someMappings =
{
        { "(.*)", anHandler }
}

CGI:run( someMappings )

http://dev.alt.textdrive.com/browser/LW/CGI.lua

http://alt.textdrive.com/svn/altdev/LW/CGI.html

Cheers,

PA.