Skip to content

Latest commit

 

History

History
91 lines (63 loc) · 3.19 KB

README.md

File metadata and controls

91 lines (63 loc) · 3.19 KB

lua-express-banner

A minimalistic web framework for Lua. High-quality port of express.js

LuaRocks License Repo Size

local express = require("express")
local app = express()

app:get("/", function(_, res)
	res:send("Hello World!")
end)

app:listen(3000)

Installation:

luarocks install lua-express

# or
docker pull ghcr.io/trigonim/lua-express:main

Features:

  • ✅ Same features as in the original express (except of rendering engine. temporarily) ➕
  • 🪞 API implementation and similarity with express.js is almost 100%. Even in small details 🔥
  • 🧩 Easy to embed into any existing lua applications of any complexity
  • 🪶 Lowest possible amount of third-party dependencies
  • 🚀 Asynchronous (non-blocking) processing of incoming requests
  • 🛠️ Easy to extend and modify with third-party modules
  • 🏋️‍♂️ Several highly loaded web applications are already running on lua-express right now

Examples:

🌈 Extra:

Dependencies

  • pegasus – minimalistic web server
  • luasocket – shipped with pegasus
  • copas (optional in the feature) – non-blocking processing of incoming requests. Also useful to make mysql/redis/http-client libs asynchronous
  • cjson (optional. Only if the res:json(obj) function is required)

Development:

flowchart LR
    Fork((Fork the project))
	Fork-->Edit[Edit files]
    Edit-->commit[Commit the changes]
    commit-->|Finally|creatpr((Create a Pull Request))
Loading
luarocks install copas
luarocks install pegasus
# not sure if this is really needed :)
luarocks install luasec

# only for res:json(obj)
# luarocks install lua-cjson

git clone https://github.com/TRIGONIM/lua-express && cd lua-express

# add local module path to LUA_PATH env
export LUA_PATH="$(pwd)/lua/?.lua;$(pwd)/lua/?/init.lua;$LUA_PATH"

# do what you want.
lua examples/cookie.lua

# commit and pull request