From bb7c69e7493611da2646bbfae8678eb003fcb06a Mon Sep 17 00:00:00 2001 From: Jonathan Date: Sat, 16 Mar 2024 20:32:35 -0500 Subject: [PATCH] learned hx-trigger --- app.lua | 16 +++++++++++++++- htmx.min.js => static/htmx.min.js | 0 views/index.etlua | 5 +++-- 3 files changed, 18 insertions(+), 3 deletions(-) rename htmx.min.js => static/htmx.min.js (100%) diff --git a/app.lua b/app.lua index 55d5b47..177a46c 100644 --- a/app.lua +++ b/app.lua @@ -4,9 +4,13 @@ local say = require('lua_scripts/main') app:enable("etlua") +app:post("/clickme", function(self) + self.plane = "P-38L" + return self.plane +end) + app:get("/", function(self) self.text = say.hello() - self.plane = { "P-38L" } return {render = "index"} end) @@ -21,6 +25,16 @@ return app + + + + + + + + + + diff --git a/htmx.min.js b/static/htmx.min.js similarity index 100% rename from htmx.min.js rename to static/htmx.min.js diff --git a/views/index.etlua b/views/index.etlua index 6cf6acb..9621738 100644 --- a/views/index.etlua +++ b/views/index.etlua @@ -1,5 +1,5 @@ - +

Hello world

Welcome to my page

@@ -18,7 +18,8 @@
- + +

    <% for i, thing in pairs(text) do %>