21 lines
543 B
Lua
21 lines
543 B
Lua
-- app.lua — application wiring, loaded by .init.lua via require "app".
|
|
--
|
|
-- Route handlers live in routes_public.lua and routes_admin.lua; this
|
|
-- module opens the database, loads them, and registers the catch-all
|
|
-- 404 (which must be the last route).
|
|
|
|
local fm = require "fm"
|
|
local db = require "db"
|
|
local web = require "web"
|
|
|
|
-- Open blog.db and apply schema (idempotent).
|
|
db.init()
|
|
|
|
require "routes_public"
|
|
require "routes_admin"
|
|
|
|
-- Catch-all 404 (must be registered last).
|
|
web.route("/*", function(r)
|
|
return web.not_found()
|
|
end)
|