From a1b1f9a17ae682460019b5bd2827f47d713b0558 Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Fri, 19 Jan 2024 23:21:08 +0100 Subject: misc: update README --- README.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7a6f4f4..1473830 100644 --- a/README.md +++ b/README.md @@ -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 -- cgit v1.3.1