peachy/assets/.init.lua

16 lines
444 B
Lua

local migrate = require "migrate"
local DB_FILENAME = "peachy.db"
sqlite3 = require "lsqlite3"
local db = sqlite3.open(DB_FILENAME)
db:exec("PRAGMA journal_mode=WAL")
db:exec("PRAGMA foreign_keys")
-- migrate.migrate(db)
fm = require "fullmoon"
fm.setTemplate({"/tmpl/", tmpl = "fmt"})
fm.setRoute("/hello/:name", function(r)
return fm.serveContent("hello", {name = r.params.name})
end)
fm.setRoute("/", fm.serveContent("opendb"))
fm.run()