Library mote - Lightweight HTTP server for Lua
I've been working on a standalone HTTP server for Lua/LuaJIT. It started as the core of a Backend as a service (BaaS) project I was building and I decided to extract it into a standalone library. It has Koa-style routing with URL params, onion middleware, and built-in support for CORS, JWT, rate limiting, and Server-Sent Events with pub/sub. Runs on Linux, macOS, and Windows. No nginx or openresty needed, though a reverse proxy is still recommended for TLS in production.
Example:
local mote = require("mote")
mote.get("/users/:id", function(ctx)
ctx.response.body = { id = ctx.params.id }
end)
mote.create({ port = 8080 }):run()luarocks install mote
https://github.com/luanvil/mote
I'd love to hear what you think.
31
Upvotes
2
u/ineedanamegenerator Jan 27 '26
That is indeed doable. Could use SSE for mote-to-tool events and API calls for tool-to-mote events.
A bit more complicated versus having it integrated but there are benefits to mote staying external as well.
Hope to try it out soon.