Make fullmoon work

This commit is contained in:
Brandon Dyck 2024-06-09 22:28:01 -06:00
parent 23ecfd9ba8
commit 98c839f868
3 changed files with 24 additions and 3 deletions

2
.gitignore vendored
View File

@ -1 +1,3 @@
redbean*.com
*.db
.build

View File

@ -1 +1,11 @@
LaunchBrowser()
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"))
print "did some stuff"
fm.run()

View File

@ -1,7 +1,16 @@
.PHONY: run
run: redbean/redbean-2.2.com
redbean/redbean-2.2.com -D .
run: .build/peachy.com
.build/peachy.com
redbean/redbean-2.2.com:
.PHONY: .build/peachy.com
.build/peachy.com: redbean/redbean-2.2.com
mkdir -p .build
# rm .build/*
cp redbean/redbean-2.2.com .build/peachy-noassets.com
zip -r .build/peachy-noassets.com .init.lua .lua
mv .build/peachy-noassets.com .build/peachy.com
.redbean/redbean-2.2.com:
wget --directory-prefix redbean https://redbean.dev/redbean-2.2.com
chmod a+x redbean/redbean-2.2.com