- It contains the output of
sailor create sailor-hello-lwan, without any changes whatsoever;
- Contains a list of dependencies as Git submodules, including Sailor MVC itself;
- A configuration file for Lwan.
- Clone Lwan:
git clone https://github.com/lpereira/lwan;
- Follow its build instructions. You'll need Lua 5.1 (from PUC-Rio) or LuaJIT 2.0. Note: although Lwan will build on OS X and FreeBSD, it uses pkg-config to find the Lua libraries; while this tool is available for these operating systems, the
.pcfile necessary to find the Lua libraries is not usually shipped with Lua itself;
- There's no need to install Lwan, but note the path to the generated
lwanbinary. It's located in the build directory, under the
- Clone this repository:
git clone https://github.com/lpereira/sailor-hello-lwan;
- Fetch the submodules:
git submodule initand then
git submodule update;
- Execute Lwan from the
/path/to/build/lwan/lwan -c conf/lwan.conf;
- It should be working! Click here to test;
- Now that it's working, consult the Things to fix section below. That's where the fun starts. Happy hacking!
Things to fix
Not everything is working in Lwan yet. Some things are easier to fix than others, and all help is welcome. It would be nice to support the following features:
- Support Friendly URLs. Lwan already support rewriting requests using Lua functions; it's just the matter of adapting the set up in
- Cookie support (for sessions, etc) is working, but currently requires minor changes inside Sailor. Ideally these abstractions should go to Remy;
- Only GET requests are supported. Lwan supports POST as well, but the Remy shim only reports that the request is a GET request through its
methodmember in the
portfields in the Remy object are hardcoded to
8080respectively. In fact, most constants in the
requesttable are wrong. This table should have a metatable and fetch the necessary fields on demand;
- While it's possible to send arbitrary header values with the response, it's not possible to read arbitrary header values from the request. It should be possible to create a metatable in Remy to offer this capability;
- Make Lwan find the Lua libraries without
- There are many others. Please open an Issue should you find other things worth fixing.
The generated code is licensed under the same terms as Sailor MVC itself. The Lwan configuration file is licensed under CC0.