peachy/assets/.init.lua

19 lines
611 B
Lua
Raw Normal View History

2024-06-11 06:13:38 +00:00
-- Normally I could use require("fennel").install(),
-- but this time I need to fix the Fennel search path.
local fennel = require("fennel")
fennel.path = "/zip/.lua/?.fnl;/zip/.lua/?/init.fnl"
table.insert(package.loaders or package.searchers, fennel.searcher)
2024-06-10 04:50:33 +00:00
-- LaunchBrowser()
2024-06-10 04:28:01 +00:00
2024-06-10 23:40:10 +00:00
local migrate = require "migrate"
migrate.migrate()
2024-06-10 04:28:01 +00:00
fm = require "fullmoon"
fm.setTemplate("hello", "Hello, {%& name %}")
fm.setRoute("/hello/:name", function(r)
return fm.serveContent("hello", {name = r.params.name})
end)
fm.setTemplate("itworks", "<h1>It works!</h1>")
fm.setRoute("/", fm.serveContent("itworks"))
fm.run()