Web development with Lua

classic Classic list List threaded Threaded
33 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Web development with Lua

luciano de souza-2
Hi all,

What is the simplest way to run a Lua script in Apache producing web
pages? I am not an experienced developer, I don't want to invest now in
very complex APIs. If I want only to be able to show some HTML pages,
process forms and query a database, is there really a simple and well
documented way to do it with Lua?

Luciano

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Petite Abeille

On Oct 17, 2011, at 2:38 AM, Luciano de Souza wrote:

> What is the simplest way to run a Lua script in Apache producing web pages? I am not an experienced developer, I don't want to invest now in very complex APIs. If I want only to be able to show some HTML pages, process forms and query a database, is there really a simple and well documented way to do it with Lua?

At this conjuncture, The Kepler project might be your best bet:

http://www.keplerproject.org/

Perhaps a mixture of CGILua:

http://keplerproject.github.com/cgilua/

And LuaSQL:

http://www.keplerproject.org/luasql/

Kepler has a friendly mailing list:

http://www.keplerproject.org/en/Mailing_List
Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Tim Mensch
In reply to this post by luciano de souza-2
On 10/16/2011 6:38 PM, Luciano de Souza wrote:
> What is the simplest way to run a Lua script in Apache producing web
> pages?

Does it have to be Apache? Or would you rather support 10x-100x or more
users on the same hardware?

Because there's a great package that includes Nginx+Lua called OpenResty
[1]. They claim you can serve 30k Lua-based pages/second on decent
hardware, and I'm getting 1800/second on a cheap VPS with no
optimization (and my benchmark may have been limited by the computer I
was requesting pages from or the benchmarking software).

The reason for the speed is that it's deeply integrated into Nginx:
Queries from Lua can yield so that the event loop doesn't block, and so
you get epoll speed from an app server driven by Lua code. The API is
really straightforward too -- good for someone who doesn't want to do
anything more complicated.

Tim

[1] http://openresty.org/

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Nathan Angelacos
In reply to this post by luciano de souza-2
On 10/16/2011 05:38 PM, Luciano de Souza wrote:

> Hi all,
>
> What is the simplest way to run a Lua script in Apache producing web
> pages? I am not an experienced developer, I don't want to invest now in
> very complex APIs. If I want only to be able to show some HTML pages,
> process forms and query a database, is there really a simple and well
> documented way to do it with Lua?
>
> Luciano
>

http://haserl.sourceforge.net

Its one CGI program, handles POST and GET requests, and basically works
like PHP, but with Lua as the scripting language.


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Sebastien Lai
In reply to this post by luciano de souza-2
On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza <[hidden email]> wrote:
> Hi all,
>
> What is the simplest way to run a Lua script in Apache producing web pages?
> I am not an experienced developer, I don't want to invest now in very
> complex APIs.

You might want to give LunarCGI[1] a try. Since the latest release, it
features LunarRouter, which parses PATH_INFO similar to ruby's
sinatra.rb

The API is also extremely simple- the directory "examples" might be of use.

Also, LunarCGI runs on bareboned CGI, and doesn't require any
additional installation. Well, except for a Lua interpreter, of
course.

[1] https://github.com/beelzebub/LunarCGI

</shameless-selfpromoting> :-P

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Tang Daogang
You can try Bamboo ( https://github.com/daogangtang/bamboo ), which is a very high productive web framework, and it is now under heavy development, we will release 1.0-rc0 in this month.


On Mon, Oct 17, 2011 at 10:21 AM, Sebastien Lai <[hidden email]> wrote:
On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza <[hidden email]> wrote:
> Hi all,
>
> What is the simplest way to run a Lua script in Apache producing web pages?
> I am not an experienced developer, I don't want to invest now in very
> complex APIs.

You might want to give LunarCGI[1] a try. Since the latest release, it
features LunarRouter, which parses PATH_INFO similar to ruby's
sinatra.rb

The API is also extremely simple- the directory "examples" might be of use.

Also, LunarCGI runs on bareboned CGI, and doesn't require any
additional installation. Well, except for a Lua interpreter, of
course.

[1] https://github.com/beelzebub/LunarCGI

</shameless-selfpromoting> :-P




--
Nothing is impossible.

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

云帆江
can you show some example by using bamboo framework or performance data

On Mon, Oct 17, 2011 at 01:03:14PM +0800, Tang Daogang wrote:

> You can try Bamboo ( https://github.com/daogangtang/bamboo ), which is a
> very high productive web framework, and it is now under heavy development,
> we will release 1.0-rc0 in this month.
>
>
> On Mon, Oct 17, 2011 at 10:21 AM, Sebastien Lai <[hidden email]>wrote:
>
> > On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza <[hidden email]>
> > wrote:
> > > Hi all,
> > >
> > > What is the simplest way to run a Lua script in Apache producing web
> > pages?
> > > I am not an experienced developer, I don't want to invest now in very
> > > complex APIs.
> >
> > You might want to give LunarCGI[1] a try. Since the latest release, it
> > features LunarRouter, which parses PATH_INFO similar to ruby's
> > sinatra.rb
> >
> > The API is also extremely simple- the directory "examples" might be of use.
> >
> > Also, LunarCGI runs on bareboned CGI, and doesn't require any
> > additional installation. Well, except for a Lua interpreter, of
> > course.
> >
> > [1] https://github.com/beelzebub/LunarCGI
> >
> > </shameless-selfpromoting> :-P
> >
> >
>
>
> --
> Nothing is impossible.

--
cheers
    Yunfan Jiang
{'nick':['jyf', 'geek42'], 'im': {'gtalk': '[hidden email]', 'irc': 'irc.freenode.net#ubuntu-cn'}, 'blog': 'http://geek42.info', 'interesting': {'teck': ['linux', 'python', 'lua', 'c', 'nosql', 'redis', 'nginx'], 'history': ['chinese history',], 'sf': [42,], 'music': ['NewAge style', 'chinese old theme', 'Any strange music']}}

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

luciano de souza-2
In reply to this post by Sebastien Lai
Observing a LunarCGI example, this library seems to be very easy. As it
seems to be created in pure Lua, C compilations won't be needed. As I
don't understand anything about C, only when available in Luarocks,
compilations are successful.

Having accessed the link you sent me, I was invited to redirect my
browser to:
http://code.google.com/p/lunarcgi/downloads/list
But here is the information there is no files to download.

Sometimes it's oubvious, but visiting the site for the first time, I
haven't often found everything I want. I am blind and I use screen
readers. So the fact I was not able to find the link for download it
probably a limitation concerned to me, not to LunarCGI site.

My intention now is only to learn, to have a contact with web
development. I don't have a system to develop. In this exactly moment,
the single user to be regarded is me!


I am sure Bamboo and Kepler are very good frameworks. I don't know, but
frameworks, in terms of productivity, are really so useful. But, now,
desiring to start in the simplest way, perhaps is more intersting to
test LunarCGI or Haserl.

Thanky you all for the gentile tips!

Em 17-10-2011 00:21, Sebastien Lai escreveu:

> On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza<[hidden email]>  wrote:
>> Hi all,
>>
>> What is the simplest way to run a Lua script in Apache producing web pages?
>> I am not an experienced developer, I don't want to invest now in very
>> complex APIs.
> You might want to give LunarCGI[1] a try. Since the latest release, it
> features LunarRouter, which parses PATH_INFO similar to ruby's
> sinatra.rb
>
> The API is also extremely simple- the directory "examples" might be of use.
>
> Also, LunarCGI runs on bareboned CGI, and doesn't require any
> additional installation. Well, except for a Lua interpreter, of
> course.
>
> [1] https://github.com/beelzebub/LunarCGI
>
> </shameless-selfpromoting>  :-P
>


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Pierre Chapuis
In reply to this post by luciano de souza-2
On Mon, 17 Oct 2011 02:46:13 +0200, Petite Abeille wrote:

> At this conjuncture, The Kepler project might be your best bet:
>
> http://www.keplerproject.org/

tl;dr: I'd +1 that.

I use different tools depending on what I want to do.

If I want to build a simple webpage using a scripting language
embedded in HTML (like you could do with PHP) I use Lua Pages
from the Kepler project [1]. This is probably your best bet.

If I want something slightly more powerful where I generate the
markup from the application, I use the Mercury micro-framework [2].
It is inspired by Sinatra (a Ruby project).

I have also tried Tir by Zed Shaw [3]. It is a very interesting way
to build Web applications but afaik. it will not work with Apache,
you will need to run Mongrel2 to use it.

[1] http://keplerproject.github.com/cgilua/manual.html#templates
[2] https://github.com/nrk/mercury
[3] http://tir.mongrel2.org/

--
Pierre Chapuis


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Pierre Chapuis
In reply to this post by luciano de souza-2
On Mon, 17 Oct 2011 08:33:07 -0200, Luciano de Souza wrote:

> I am sure Bamboo and Kepler are very good frameworks. I don't know,
> but frameworks, in terms of productivity, are really so useful. But,
> now, desiring to start in the simplest way, perhaps is more
> intersting
> to test LunarCGI or Haserl.

Kepler is not a framework. It is a projects that provides a whole Web
stack for Lua. At least one of the components it provides (Orbit) is
a MVC framework but you don't need to use it.

CGILua is similar to LunarCGI, but sadly I just found out that it
is no longer maintained :(

Another choice for you could be to use WSAPI [1] directly. Maybe
you will find it too low level but I've done it and it is not as
complicated as it seems.

[1] http://keplerproject.github.com/wsapi/

--
Pierre Chapuis

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Sebastien Lai
In reply to this post by luciano de souza-2
On Mon, Oct 17, 2011 at 12:33 PM, Luciano de Souza <[hidden email]> wrote:

> Observing a LunarCGI example, this library seems to be very easy. As it
> seems to be created in pure Lua, C compilations won't be needed. As I don't
> understand anything about C, only when available in Luarocks, compilations
> are successful.
>
> Having accessed the link you sent me, I was invited to redirect my browser
> to:
> http://code.google.com/p/lunarcgi/downloads/list
> But here is the information there is no files to download.
>
> Sometimes it's oubvious, but visiting the site for the first time, I haven't
> often found everything I want. I am blind and I use screen readers. So the
> fact I was not able to find the link for download it probably a limitation
> concerned to me, not to LunarCGI site.

I am sorry, but due to LunarCGI still being in a fairly early state,
providing 'official' downloads would be currently rather foolish.

However, apart from cloning LunarCGI using 'git'
(http://git-scm.org/), you can also download the latest HEAD (similar
to 'trunk' in subversion), using this link:

https://github.com/beelzebub/LunarCGI/zipball/master

It will download a zip archive of the latest commit.

Hope this helps

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Philippe Lhoste
In reply to this post by luciano de souza-2
On 17/10/2011 02:38, Luciano de Souza wrote:
> What is the simplest way to run a Lua script in Apache producing web pages? I am not an
> experienced developer, I don't want to invest now in very complex APIs. If I want only to
> be able to show some HTML pages, process forms and query a database, is there really a
> simple and well documented way to do it with Lua?

A long, long time ago, in a far away galaxy, er, no, but that's old, for sure, I plugged a
Lua script into IIS (Internet Information Services, Microsof's Web server, which we used
at work at the time). It was quite simple, and I was able to interpret queries and server
pages with pure Lua.
The code is:
http://bazaar.launchpad.net/~philho/+junk/Lua/view/head:/TestCGI.lua

Quite outdated (HTML 4? Lua 5.0! Entities...) but perhaps simple enough to learn a bit
from it. I recommend, of course, to use more the robust libraries mentioned in this
thread... :-)
Well, I mentioned it just to say that indeed, if you can plug in a language able to
manipulate stdin and stdout into a Web server, you are already able to write a dynamic site.

--
Philippe Lhoste
--  (near) Paris -- France
--  http://Phi.Lho.free.fr
--  --  --  --  --  --  --  --  --  --  --  --  --  --


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

luciano de souza-2
In reply to this post by Pierre Chapuis
Step by step, let me describe what I could understand.

1.The configuration
I use Ubuntu 10.10 and I have installed lua5.1, luarocks and apache.
The CGILUa  documentation is appropriate to beginers, so I started to it.
The first step is to install cgilua, so:
luarocks install cgilua
Now, it's time to move cgilua from /home/luciano/.luarocks.. to a path
accessible from Lua interpreter.
/usr/lib/lua/5.1 is a very good option, since luasql and other Lua
libraries are already there.
I don't understand if cgilua can be used with Apache, but I know other  
implementations under the Keppler Project can't.
If  Apache is supported, now I need to create an example and,
considering it is a cgi application, to move it to /usr/lib/cgi-bin.
For each file, I should give permissions with: "sudo chmod +X".
In thesis, I would be ready to run my first example.
http://localhost/cgi-bin/test.lua
or
http://localhost/cgi-bin/test.lp
Is this the procedure?

2. The usage
A PHP like style is a pleasant way to code. So I wanted Lua pages. If I
understand, I can imagine two files:
test.lp - with the template
functions.lua - with a brand new  bilion of Lua functions created by me.
In test.lp, I will have something like this:

<?lua loadfile('functions.lua') ?>
<html>
<head>
<title> <%=title %> </title>
</head>
<body>
<table>
<% for row in pairs(query) do %>
<tr><td><% row.name %></td><td><% row.phone %> </td></tr>
<% end %>
</table>
</body>
</html>

This could be a query from a database or simple an iteration of a Lua table.

If I am able to show something and process some user input, well, I have
enough to play a little bit. If I was correctly described the process
above, I have any idea how to show something. But how to process inputs?

<input type = "text" name = "name">

In the HTML code, I have created an input box  identified with the
variable "name".

In Lua code, I will have something like:

contact:add(name, phone, address)

But how to connect "name", the Lua variable and "name", the HTML variable?

Am I in the correct way?

Em 17-10-2011 08:48, Pierre Chapuis escreveu:

> On Mon, 17 Oct 2011 08:33:07 -0200, Luciano de Souza wrote:
>
>> I am sure Bamboo and Kepler are very good frameworks. I don't know,
>> but frameworks, in terms of productivity, are really so useful. But,
>> now, desiring to start in the simplest way, perhaps is more intersting
>> to test LunarCGI or Haserl.
>
> Kepler is not a framework. It is a projects that provides a whole Web
> stack for Lua. At least one of the components it provides (Orbit) is
> a MVC framework but you don't need to use it.
>
> CGILua is similar to LunarCGI, but sadly I just found out that it
> is no longer maintained :(
>
> Another choice for you could be to use WSAPI [1] directly. Maybe
> you will find it too low level but I've done it and it is not as
> complicated as it seems.
>
> [1] http://keplerproject.github.com/wsapi/
>


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Pierre Chapuis
In reply to this post by luciano de souza-2
To setup CGILua with Apache, start here:
http://www.keplerproject.org/en/UNIX_Installation

About input handling in Lua Pages, you can take
a look at this simple page for example:

ftp://catwell.info/code/deprecated/homepage/lua-pages/index.lp

--
Pierre Chapuis


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Peng Zhicheng
In reply to this post by luciano de souza-2
于 2011-10-17 21:22, Luciano de Souza 写道:
> Step by step, let me describe what I could understand.
>
> [...]
>
>
> But how to connect "name", the Lua variable and "name", the HTML variable?
>
>
>

the cgilua would handle the varibles for you, then you can access them
from cgilua.GET and cgilua.POST table, depending how the data are committed.
see the documents and examples.


the examples from the cgilua codebase is very short and comprehensive,
you should check it.

a short description here:
the login.lp page contains forms of username and pass,
and the check.lua script checks them for validation,
and redirects to another page on success, or otherwise
re-display login.lp again with the username already filled.

Note though, the login.lp has a small error: the `action' attribute of the form
should point to the URL of "check.lua" script, which SHOULD be run
by the web server as a CGI program if properly configured. you might need to
insert a `shebang line' pointing to a lua interpretor.

[1] login.lp : https://github.com/keplerproject/cgilua/blob/master/examples/login.lp
[2] check.lua: https://github.com/keplerproject/cgilua/blob/master/examples/check.lua


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

luciano de souza-2
I am trying to run test.lp from the example folder of CGIlua.

Having downloaded cgilua from Luarocks, I found the following content:

./.luarocks/bin/cgilua.cgi
./.luarocks/lib/lua/5.1/lfs.so
./.luarocks/share/lua/5.1/chilua

I moved the all content   in each folder to the respective position in
/usr. The directory /usr/lib/lua/5.1 didn't not exist. So I created it.

I moved also the example folder to /usr/lib/cgi-bin and I give 755
permission for all.

I try:

http://localhost/cgi-bin/test.lp

"500: internal server error"

Reading the specific instructions for Apache, I understood that
cgilua.cgi should be in /usr/lib/cgi-bin. I did it. The result is 500 error.

So I remember Apache has two important folders:

/usr/lib/cgi-bin
/var/www

I placed test.lp /var/www. The content is shown, but also all its code
without any interpretation.

I placed cgilua.lcgi in /var/www. The result was the same.

In test.lp I always made sure that "#!" points to the cgilua.cgi location.

I could not understand. Running CGI with Pascal, it's sufficient to
place cgi module in /usr/lib/cgi-bin and call something like:
http://localhost/cgi-bin/test.cgi.

As Lua is an interpreted language, I don't know if the procedure is the
same.

Well, perhaps the first "hello world" is a little bit more complicated
than we would like.

Sorry for asking so much.


Em 17-10-2011 12:06, Peng Zhicheng escreveu:

> 于 2011-10-17 21:22, Luciano de Souza 写道:
>> Step by step, let me describe what I could understand.
>>
>> [...]
>>
>>
>> But how to connect "name", the Lua variable and "name", the HTML
>> variable?
>>
>>
>>
>
> the cgilua would handle the varibles for you, then you can access them
> from cgilua.GET and cgilua.POST table, depending how the data are
> committed.
> see the documents and examples.
>
>
> the examples from the cgilua codebase is very short and comprehensive,
> you should check it.
>
> a short description here:
> the login.lp page contains forms of username and pass,
> and the check.lua script checks them for validation,
> and redirects to another page on success, or otherwise
> re-display login.lp again with the username already filled.
>
> Note though, the login.lp has a small error: the `action' attribute of
> the form
> should point to the URL of "check.lua" script, which SHOULD be run
> by the web server as a CGI program if properly configured. you might
> need to
> insert a `shebang line' pointing to a lua interpretor.
>
> [1] login.lp :
> https://github.com/keplerproject/cgilua/blob/master/examples/login.lp
> [2] check.lua:
> https://github.com/keplerproject/cgilua/blob/master/examples/check.lua
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Matthew Wild

When Apache gives a 500 error you should look in /var/log/apache/error.log for the message, it should help you identify what is wrong.

Regards,
Matthew

On 17 Oct 2011 16:29, "Luciano de Souza" <[hidden email]> wrote:

I am trying to run test.lp from the example folder of CGIlua.

Having downloaded cgilua from Luarocks, I found the following content:

./.luarocks/bin/cgilua.cgi
./.luarocks/lib/lua/5.1/lfs.so
./.luarocks/share/lua/5.1/chilua

I moved the all content   in each folder to the respective position in /usr. The directory /usr/lib/lua/5.1 didn't not exist. So I created it.

I moved also the example folder to /usr/lib/cgi-bin and I give 755 permission for all.

I try:

http://localhost/cgi-bin/test.lp

"500: internal server error"

Reading the specific instructions for Apache, I understood that cgilua.cgi should be in /usr/lib/cgi-bin. I did it. The result is 500 error.

So I remember Apache has two important folders:

/usr/lib/cgi-bin
/var/www

I placed test.lp /var/www. The content is shown, but also all its code without any interpretation.

I placed cgilua.lcgi in /var/www. The result was the same.

In test.lp I always made sure that "#!" points to the cgilua.cgi location.

I could not understand. Running CGI with Pascal, it's sufficient to place cgi module in /usr/lib/cgi-bin and call something like: http://localhost/cgi-bin/test.cgi.

As Lua is an interpreted language, I don't know if the procedure is the same.

Well, perhaps the first "hello world" is a little bit more complicated than we would like.

Sorry for asking so much.


Em 17-10-2011 12:06, Peng Zhicheng escreveu:


>
> 于 2011-10-17 21:22, Luciano de Souza 写道:
>>
>> Step by step, let me describe what I could under...

Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Victor Young
In reply to this post by 云帆江
You can try http://top-edu.cn/http://51jianzhiwang.cn/http://www.onewin.cn/, those websites are designed with bamboo. Later we will provide some examples with source code, and we are trying to accomplish some documents. 

2011/10/17 jyf <[hidden email]>
can you show some example by using bamboo framework or performance data

On Mon, Oct 17, 2011 at 01:03:14PM +0800, Tang Daogang wrote:
> You can try Bamboo ( https://github.com/daogangtang/bamboo ), which is a
> very high productive web framework, and it is now under heavy development,
> we will release 1.0-rc0 in this month.
>
>
> On Mon, Oct 17, 2011 at 10:21 AM, Sebastien Lai <[hidden email]>wrote:
>
> > On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza <[hidden email]>
> > wrote:
> > > Hi all,
> > >
> > > What is the simplest way to run a Lua script in Apache producing web
> > pages?
> > > I am not an experienced developer, I don't want to invest now in very
> > > complex APIs.
> >
> > You might want to give LunarCGI[1] a try. Since the latest release, it
> > features LunarRouter, which parses PATH_INFO similar to ruby's
> > sinatra.rb
> >
> > The API is also extremely simple- the directory "examples" might be of use.
> >
> > Also, LunarCGI runs on bareboned CGI, and doesn't require any
> > additional installation. Well, except for a Lua interpreter, of
> > course.
> >
> > [1] https://github.com/beelzebub/LunarCGI
> >
> > </shameless-selfpromoting> :-P
> >
> >
>
>
> --
> Nothing is impossible.

--
cheers
   Yunfan Jiang
{'nick':['jyf', 'geek42'], 'im': {'gtalk': '[hidden email]', 'irc': '<a href="http://irc.freenode.net#ubuntu-cn&#39;" target="_blank">irc.freenode.net#ubuntu-cn'}, 'blog': 'http://geek42.info', 'interesting': {'teck': ['linux', 'python', 'lua', 'c', 'nosql', 'redis', 'nginx'], 'history': ['chinese history',], 'sf': [42,], 'music': ['NewAge style', 'chinese old theme', 'Any strange music']}}


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Victor Young
In reply to this post by 云帆江
For more infomation about bamboo, visit http://daogangtang.iteye.com/category/159985.

2011/10/17 jyf <[hidden email]>
can you show some example by using bamboo framework or performance data

On Mon, Oct 17, 2011 at 01:03:14PM +0800, Tang Daogang wrote:
> You can try Bamboo ( https://github.com/daogangtang/bamboo ), which is a
> very high productive web framework, and it is now under heavy development,
> we will release 1.0-rc0 in this month.
>
>
> On Mon, Oct 17, 2011 at 10:21 AM, Sebastien Lai <[hidden email]>wrote:
>
> > On Mon, Oct 17, 2011 at 2:38 AM, Luciano de Souza <[hidden email]>
> > wrote:
> > > Hi all,
> > >
> > > What is the simplest way to run a Lua script in Apache producing web
> > pages?
> > > I am not an experienced developer, I don't want to invest now in very
> > > complex APIs.
> >
> > You might want to give LunarCGI[1] a try. Since the latest release, it
> > features LunarRouter, which parses PATH_INFO similar to ruby's
> > sinatra.rb
> >
> > The API is also extremely simple- the directory "examples" might be of use.
> >
> > Also, LunarCGI runs on bareboned CGI, and doesn't require any
> > additional installation. Well, except for a Lua interpreter, of
> > course.
> >
> > [1] https://github.com/beelzebub/LunarCGI
> >
> > </shameless-selfpromoting> :-P
> >
> >
>
>
> --
> Nothing is impossible.

--
cheers
   Yunfan Jiang
{'nick':['jyf', 'geek42'], 'im': {'gtalk': '[hidden email]', 'irc': '<a href="http://irc.freenode.net#ubuntu-cn&#39;" target="_blank">irc.freenode.net#ubuntu-cn'}, 'blog': 'http://geek42.info', 'interesting': {'teck': ['linux', 'python', 'lua', 'c', 'nosql', 'redis', 'nginx'], 'history': ['chinese history',], 'sf': [42,], 'music': ['NewAge style', 'chinese old theme', 'Any strange music']}}


Reply | Threaded
Open this post in threaded view
|

Re: Web development with Lua

Victor Young
In reply to this post by Pierre Chapuis
Bamboo is a framework based on Tir and is more powerful.

2011/10/17 Pierre Chapuis <[hidden email]>
On Mon, 17 Oct 2011 02:46:13 +0200, Petite Abeille wrote:

At this conjuncture, The Kepler project might be your best bet:

http://www.keplerproject.org/

tl;dr: I'd +1 that.

I use different tools depending on what I want to do.

If I want to build a simple webpage using a scripting language
embedded in HTML (like you could do with PHP) I use Lua Pages
from the Kepler project [1]. This is probably your best bet.

If I want something slightly more powerful where I generate the
markup from the application, I use the Mercury micro-framework [2].
It is inspired by Sinatra (a Ruby project).

I have also tried Tir by Zed Shaw [3]. It is a very interesting way
to build Web applications but afaik. it will not work with Apache,
you will need to run Mongrel2 to use it.

[1] http://keplerproject.github.com/cgilua/manual.html#templates
[2] https://github.com/nrk/mercury
[3] http://tir.mongrel2.org/

--
Pierre Chapuis



12