18 lines
485 B
Lua
18 lines
485 B
Lua
-- LaunchBrowser()
|
|
|
|
local migrate = require "migrate"
|
|
|
|
local DB_FILENAME = "peachy.db"
|
|
sqlite3 = require "lsqlite3"
|
|
local db = sqlite3.open(DB_FILENAME)
|
|
db:exec("PRAGMA journal_mode=WAL;")
|
|
migrate.migrate(db)
|
|
|
|
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() |