peachy/assets/.init.lua

18 lines
458 B
Lua
Raw Normal View History

LaunchBrowser()
2024-06-10 04:28:01 +00:00
2024-06-10 23:40:10 +00:00
local migrate = require "migrate"
2024-07-06 17:41:55 +00:00
local DB_FILENAME = "peachy.db"
sqlite3 = require "lsqlite3"
local db = sqlite3.open(DB_FILENAME)
2024-07-06 19:14:08 +00:00
db:exec("PRAGMA journal_mode=WAL")
db:exec("PRAGMA foreign_keys")
2024-07-06 17:41:55 +00:00
migrate.migrate(db)
2024-06-10 23:40:10 +00:00
2024-06-10 04:28:01 +00:00
fm = require "fullmoon"
fm.setTemplate({"/tmpl/", tmpl = "fmt"})
2024-06-10 04:28:01 +00:00
fm.setRoute("/hello/:name", function(r)
return fm.serveContent("hello", {name = r.params.name})
end)
fm.setRoute("/", fm.serveContent("opendb"))
2024-06-10 04:28:01 +00:00
fm.run()