Skip to content

Quick Start

  1. Create an app.lua file:

    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)
  2. Run it with any Lua interpreter:

    Terminal window
    lua app.lua
    # Listening on http://localhost:3000
  3. Try it out:

    Terminal window
    curl http://localhost:3000/
    # Hello from Ludi!
    curl http://localhost:3000/users/42
    # {"id":"42"}
  • 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.
  • Routing — methods, path params, route groups, 404/500 behavior.
  • Middlewares — global and per-route chains.
  • Architecture — how Lua and Rust split the work.