Astra is a web server runtime for Lua (5.1-5.4), Luau and LuaJIT written in Rust. The goal is to get as much performance as possible while writing the web server logic in Lua instead for faster iteration, fault-tolerance and no-build requirements. This project is internally used here at ArkForge and many others.
Installation
You can either get the binaries at github releases or using cargo
if you have it installed:
To install with differet Lua VM, e.g. Lua 5.4:
Example
-- Create a new server
local server = Astra..:
-- Register a route
server:
-- Configure the server
server. = 3000
-- Run the server
server:
You can also use the local variables within routes
local counter = 0
server:
Requests and Responses and their configuration are provided when needed
server:
There are also utilities provided such as a PostgreSQL/SQLite, http client requests, lua extra utils, and async tasks.
-- spawn an async task that does not block the running thread
spawn_task
Note
This project may have breaking changes in minor versions until v1.0. Afterwhich semver will be followed. Contributions are always welcome!