Quick Start
-
Create an
app.luafile:local ludi = require("ludi")local app = ludi.new()app:get("/", function(req, res)res:send("Hello from Ludi!")end)app:get("/users/:id", function(req, res)res:json({ id = req.params.id })end)app:listen(3000, function()print("Listening on http://localhost:3000")end) -
Run it with any Lua interpreter:
Terminal window lua app.lua# Listening on http://localhost:3000 -
Try it out:
Terminal window curl http://localhost:3000/# Hello from Ludi!curl http://localhost:3000/users/42# {"id":"42"}
What just happened?
Section titled “What just happened?”ludi.new()creates an app: a router plus a middleware chain.app:get(path, handler)registers a route. Handlers receive a Request and a Response.app:listen(port, callback)hands the socket to the Rust core (hyper + tokio) and blocks. All your Lua code keeps running on a single thread — concurrency lives in the runtime, Node-style.
Next steps
Section titled “Next steps”- Routing — methods, path params, route groups, 404/500 behavior.
- Middlewares — global and per-route chains.
- Architecture — how Lua and Rust split the work.
