Skip to content
/ luexp Public

an roblox module for hosting web apis.based off express.js

License

Notifications You must be signed in to change notification settings

luexplua/luexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

luexp

Luexp is a web framework for Roblox LuaU, inspired by Express.js. It’s designed specifically for the Roblox environment to make creating web APIs easier and more intuitive.

Table of Contents

Getting Started

Here’s a quick example to set up your first Luexp application:

local luexp = require(path.to.luexp)
local app = luexp()

app.get("/", function(req, res)
    res.send("Hello!")
end)

app.listen("example", function(url)
    print(`App listening on {url}!`)
end)

Installation

Download the latest release from here and place the Luexp module anywhere within your Roblox game files.

Why Use Luexp?

Luexp brings a familiar Express.js-like syntax to Roblox, simplifying API creation. It’s ideal for developers who:

  • Want to structure their code using a web framework approach.
  • Need flexible HTTP request handling directly within Roblox LuaU.
  • Appreciate an open-source and minimalistic framework tailored for the Roblox environment.

Features

  • Express 5-based: Familiar patterns and methods inspired by Express.
  • Roblox-friendly: Designed specifically for use in Roblox games and projects.
  • Minimalistic & Free: Lightweight and free to use with no hidden costs.
  • Cross-Compatible: Works seamlessly with Luexp v1.x projects.

Performance

We conducted a series of performance benchmarks on both versions of the API under identical conditions, utilizing the same environment for all tests. Each API was subjected to a workload of 1,000 requests with a concurrency level set to 100.

The results demonstrated that v2 exhibits an average response time improvement of approximately 96.23% compared to v1. This substantial enhancement highlights the efficiency of the new implementation in handling high-frequency requests:

image

In contrast, when evaluating the performance with larger data payloads of 5 MB across 10 requests, our findings indicated that v2 performed 37.48% slower than v1 in terms of average response time. This discrepancy suggests that while the new API excels in handling a higher volume of smaller requests, it may encounter challenges with larger data transmissions:

image

Our performance benchmarks revealed significant improvements in Luexp v2's scalability compared to v1. While v2 can handle high volumes of concurrent requests, extremely rapid request rates can lead to issues like HTTP 502 errors. In contrast, Luexp v1 cannot handle high volumes of requests at all and will throw timeout errors. Once this stage is reached, v1 will stop responding to any further requests until it's restarted. This difference in behavior, discovered during our benchmarking, highlights the greater scalability and stability of Luexp v2 for projects requiring high request handling.


Key Observations

  • All benchmarks were executed in a controlled environment to ensure comparability, focusing solely on the variations introduced by the different API versions.

Contributing

Contributions are always welcome! If you have a bug fix, feature suggestion, or improvement, feel free to submit a pull request or open an issue. Every contribution helps make Luexp better for everyone.

Contact

Have questions or suggestions? Feel free to reach out via email at [email protected].

License

Luexp is open-source software licensed under the MIT License.