Getting Started
Lynx is a fast and simple web framework for Lune, a general purpose runtime for the Luau programming language. Lynx is inspired by Hono and shares a similar API.
Basic usage
Installation
To install Lynx, add the repository as a submodule in your project.
This will add Lynx to your project in the lynx
directory.
To update Lynx, update the submodule from the remote.
Editor setup and require aliases
To make importing Lynx easier, you can add a .luaurc
require alias to your project:
If you’re using the Luau LSP VSCode extension, add this directoryAlias
to your VSCode workspace’s settings.json
:
This should give you inline autocompletion, inline documentation, and type-hinting support in your editor.
If you encounter “invalid require” TypeErrors or other issues when trying to require Lynx, try:
- closing and re-opening your
.luau
files, - making sure you’ve opened the current folder as a VSCode workspace,
- checking your
.luaurc
anddirectoryAliases
for syntax, spelling, invalid whitespaces and/or missing trailing slashes (sometimes can cause platform-specific issues), - and restarting the Luau LSP extension.
Using Lynx in your project
Now you can require Lynx using the alias "@lynx/lynx"
:
Features
- 🧩 Simple API - Convenient methods for creating routes and generating a response
- ⚡️ Fast Routing - Efficient routing using a radix tree
- 📦 Intuitive Middleware - Extend request handling easily
Use cases
Lynx can be used to write a simple web API, a quick-and-easy simple html website, a proxy server, or to glue other web services together for extra potential!