lua-users home
lua-l archive

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


Hi, Petite.

This is fantastic. I was thinking of using the TCPServer and had been
going over the source to understand how it all works. I am new to Lua
and was figuring out [at least trying to] all the metatable magic in
HTTP.lua

Thank you for such a wonderful contribution.
Ashish

On Sat, Oct 3, 2009 at 6:09 PM, Petite Abeille <petite.abeille@gmail.com> wrote:
>
> On Oct 3, 2009, at 1:20 PM, Ashish Shrestha wrote:
>
>> Just wanted to share something I recently found -- Mercury, a Sinatra
>> like framework for Lua [http://github.com/nrk/mercury]
>>
>> I am using it with Xavante (without everything else from Kepler) and
>> using the script from Fabio Mascarenhas
>> [http://lua-users.org/lists/lua-l/2009-09/msg00780.html] to launch the
>> web application.
>
> Here is an example on how to run Mercury with Nanoki's HTTP engine [1],
> using it's build in TCPServer [2] and a WSAPI handler [3]:
>
> local HTTP = require( 'HTTP' )
> local TCPServer = require( 'TCPServer' )
> local WSAPI = require( 'WSAPI' )
>
> HTTP[ '.*' ] = WSAPI( require( 'greetings' ).run )
> TCPServer( '127.0.0.1', 1080 )( HTTP )
>
> While this "work", none of this necessarily make any sense :)
>
> [1] http://dev.alt.textdrive.com/browser/HTTP/HTTP.lua
> [2] http://dev.alt.textdrive.com/browser/HTTP/TCPServer.lua
> [3] http://dev.alt.textdrive.com/browser/HTTP/WSAPI.lua
>