luajls is a set of Lua modules for developing stand-alone Lua applications.
The modules provide general-purpose functions such as class definition and promise, to operating system abstractions such as file system and network access. The modules support asynchronous I/O based on event loops.
The main targeted OSes are Linux and Windows. The only required dependency is Lua 5.4 Other dependencies are Lua native modules such as lfs, luasocket, luv, lua-openssl, lua-cjson.
The following packages are available.
The following is the hello world HTTP server script.
local event = require('jls.lang.event') local HttpServer = require('jls.net.http.HttpServer') local hostname, port = '::', 3001 local httpServer = HttpServer:new() httpServer:bind(hostname, port):next(function() print('Server bound to "'..hostname..'" on port '..tostring(port)) end) httpServer:createContext('/', function(httpExchange) local response = httpExchange:getResponse() response:setBody([[<!DOCTYPE html> <html> <body> <p>It works !</p> </body> </html> ]]) end ) event:loop()