diff options
| author | Stanisław Zagórowski <hasohasacz@gmail.com> | 2024-01-19 23:21:08 +0100 |
|---|---|---|
| committer | Stanisław Zagórowski <hasohasacz@gmail.com> | 2024-01-19 23:21:08 +0100 |
| commit | a1b1f9a17ae682460019b5bd2827f47d713b0558 (patch) | |
| tree | 9a2df3f3d6c030324b2b6100a64d9aa51181bf2d /README.md | |
| parent | 0cc1ef7105964645500e1113be908fdc50e9d89c (diff) | |
misc: update README
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -44,12 +44,15 @@ The project was heavily inspired by Ben Visness' blog post, which I highly recommend reading. ## API -Reluax expects to run a directory of files, with the entry point being `reluax.lua(x)` -This module needs to return a table containing the member function `route`. +A Reluax project is very simple. Reluax expects to run a directory of files, +with the entry point being `reluax.luax` or `reluax.lua`. This module needs +to return a table containing the member function `route`, and optionally a +project name under the key `name`. For code examples, check the +[examples](https://github.com/Duckonaut/reluax/tree/main/example) directory. -This function will be called with the path and optionally method and body of a -request, and can return a variety of responses, by returning two values: the -status code, and the response body. +The `route` function will be called with the path and, optionally, method and +body of a request, and can return a variety of responses, by returning two +values: the status code, and the response body. The response body will usually be a table, and by default will be treated as a HTML page (see `example/basic/`). It can be optionally wrapped using the functions |
