19 lines
611 B
Lua
19 lines
611 B
Lua
-- 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)
|
|
|
|
-- LaunchBrowser()
|
|
|
|
local migrate = require "migrate"
|
|
migrate.migrate()
|
|
|
|
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() |