lua-users home
lua-l archive

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

I'm pleased to announce Fullmoon [1] - a Lua web framework for Redbean
[2] (a portable, single-file distributable web server).

These are the features that Redbean provides:
- Single file deployment and distribution (Linux, Windows, and macOS)
- Efficient serving of static and gzip encoded assets
- Integrated SSL support (using MbedTLS) including SSL virtual hosting
- Integrated crypto hashing (SHA1, SHA224/256/384/512, and BLAKE2B256)
- Integrated password-hashing (using Argon2)
- HTTP/HTTPS client for external requests
- Ships with Lua 5.4 and SQLite 3.35

And this is what Fullmoon adds to it:
- Lightweight package (~500 LOC) with no external dependencies
- Simple and flexible routing with variables and custom filters
- Template engine with JSON support and efficient memory utilization
- Optimized execution with pre-compiled routes and lazy loaded methods
- Cookie/header generation and processing
- Custom 404 and other status pages
- Access to all Redbean features

I realize that there are already several web frameworks in Lua and in
fact started with integrating Lapis with Redbean (I can share what I
ended up with if someone is interested), but due to the differences
between nginx and Redbean models, this ended up being a bit of a dead
end that couldn't leverage everything that Redbean provides out of the
box (or at least not easily).

Here is a working examples that registers a template and a route that
returns a response:

local fm = require "fullmoon"
fm.setTemplate("hello", "Hello, {%& name %}")
fm.setRoute("/hello/:name", function(r)
    return fm.serveContent("hello", {name =})

You may check the project documentation and let me know your
comments/feedback. Thank you.