2024-06-10 23:40:10 +00:00
|
|
|
local migrate = require "migrate"
|
2024-07-05 00:13:09 +00:00
|
|
|
|
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-18 06:46:33 +00:00
|
|
|
-- migrate.migrate(db)
|
2024-06-10 23:40:10 +00:00
|
|
|
|
2024-06-10 04:28:01 +00:00
|
|
|
fm = require "fullmoon"
|
2024-07-10 22:36:24 +00:00
|
|
|
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)
|
2024-07-10 22:36:24 +00:00
|
|
|
fm.setRoute("/", fm.serveContent("opendb"))
|
2024-06-10 04:28:01 +00:00
|
|
|
fm.run()
|