From 0cc1ef7105964645500e1113be908fdc50e9d89c Mon Sep 17 00:00:00 2001 From: Stanisław Zagórowski Date: Fri, 19 Jan 2024 23:17:28 +0100 Subject: example: add basic, move hello world into its own dir --- example/hello-world/index.luax | 14 ++++++++++++++ example/hello-world/reluax.luax | 24 ++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 example/hello-world/index.luax create mode 100644 example/hello-world/reluax.luax (limited to 'example/hello-world') diff --git a/example/hello-world/index.luax b/example/hello-world/index.luax new file mode 100644 index 0000000..3dff259 --- /dev/null +++ b/example/hello-world/index.luax @@ -0,0 +1,14 @@ +return function() + return + + Reluax + + +

Reluax Test

+

Random number for you: {$ tostring(math.floor(math.random() * 100)) $}

+

+ What font size is this? +

+ + +end diff --git a/example/hello-world/reluax.luax b/example/hello-world/reluax.luax new file mode 100644 index 0000000..2562fb1 --- /dev/null +++ b/example/hello-world/reluax.luax @@ -0,0 +1,24 @@ +local index = require("index") + +math.randomseed(os.time()) + +local function route(path) + if path == '/' then + return 200, index() + end + + return 404, + + Error 404 + + +

Error 404

+

Page not found.

+ + +end + +return { + name = "hello-world", + route = route +} -- cgit v1.3.1