aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorStanisław Zagórowski <hasohasacz@gmail.com>2024-01-19 23:17:28 +0100
committerStanisław Zagórowski <hasohasacz@gmail.com>2024-01-19 23:17:28 +0100
commit0cc1ef7105964645500e1113be908fdc50e9d89c (patch)
treeae0394eddfa45b8290fdb73a41ebbbb7db7f17f1 /example
parent3e73bbaf796a080412c8368a821eb44b1371d761 (diff)
example: add basic, move hello world into its own dir
Diffstat (limited to 'example')
-rw-r--r--example/basic/reluax.luax20
-rw-r--r--example/hello-world/index.luax (renamed from example/index.luax)0
-rw-r--r--example/hello-world/reluax.luax (renamed from example/reluax.luax)0
3 files changed, 20 insertions, 0 deletions
diff --git a/example/basic/reluax.luax b/example/basic/reluax.luax
new file mode 100644
index 0000000..bba3e1a
--- /dev/null
+++ b/example/basic/reluax.luax
@@ -0,0 +1,20 @@
+local route = function(path)
+ if path == '/' then
+ return 200,
+ <html>
+ <head>
+ <title>basic-example</title>
+ </head>
+ <body>
+ <h1>This is the simplest example of a Reluax application.</h1>
+ </body>
+ </html>
+ end
+
+ return 404, 'Not Found'
+end
+
+return {
+ name = 'basic-example',
+ route = route
+}
diff --git a/example/index.luax b/example/hello-world/index.luax
index 3dff259..3dff259 100644
--- a/example/index.luax
+++ b/example/hello-world/index.luax
diff --git a/example/reluax.luax b/example/hello-world/reluax.luax
index 2562fb1..2562fb1 100644
--- a/example/reluax.luax
+++ b/example/hello-world/reluax.luax