function handler(req, res) { const sql = require("db")("bliss").sql; const kind = "template"; const artifact = sql.prepare("SELECT * FROM templates WHERE id = ?").get(req.params.id); if (!artifact) return res.status(404).send("Template not found"); res.render("inspector/artifact_editor", { kind, artifact }); }