lua-web2 is a simple lua interpreter
that I've custom built with a bunch of extra code that makes generating
CGI scripts easier (when using lua, anyway). |
This is the second generation of lua-web (hence the name lua-web2). Like the previous version, it has support for GET and POST forms, multipart form data, file uploads, getting jpeg image dimensions, getting contents of directories, stat'ing files and other random extensions. This version also includes some simple classes that wrap HTML generation, cookie support, and is linked against sqlite3 so that it can support databases.
This is written mostly in pure C, since I'm a master of reinventing the wheel. Parts of the database layer and the html code generator are written in lua, precompiled, and bound to the executable. The upshot of this is that a single binary is all that you need in order to run your scripts. This is a boon if you're using hosting that doesn't provide you the access you need to install perl modules and so on.
At the moment, the only documentation available is contained in the source code, although this may change in the future.
You can download lua-web as source, or pre-compiled binaries (linux x86 only). The binary package contains a dynamically linked binary and a static binary. The dynamic library only needs standard things like the libc and whatnot, so you should try that one first. The binaries were compiled on slackware, but should work on just about any linux distro. The code should compile without troubles on any system that supports both sqlite3 and lua, although I've only ever tested under linux.
To compile the source code, you will need lua 5.0.2 or better and sqlite 3.2.2 or better.
The source download includes a file which gives compilation and installation instructions.
lua-web is, naturally, freely available to anyone who wants it. I doubt anyone is going to get rich off this. I would ask that you don't pass it off as your own, or something. And, if you add anything good to it, or find a bug and fix it, please let me know so that I can roll that back into mine.
There is also no warranty of any kind, including that this will do something that you want and not do something bad, like wipe out your hard drive or something. If anything goes bad, I didn't do it!
The latest version is 2.0.4, which includes the following changes:
- Modified to use lua-sqlite3 version 0.3. We still use the code internally instead of building the library and then linking to it (since the default wants to do this dynamically).
[ lua-web 2.0.4 source
lua-web 2.0.4 binaries
lua-web 1.0.3 (historical interest)