Forgot controllers.

main
Zed A. Shaw 10 months ago
parent 9a730cd5d6
commit ded0867b9e
  1. 16
      controllers/todo.js

@ -0,0 +1,16 @@
import { ToDo } from "../lib/models.js";
import nunjucks from "nunjucks";
export class Todo {
constructor() {
}
async get(req, rep) {
const todo_list = await ToDo.all({});
const result = nunjucks.render("todo.html",
{todo_list, name: "Zed"});
rep.code(200).type("text/html").send(result);
}
}
Loading…
Cancel
Save