text: var express = require("express");
  var router = express.Router();
  var burger = require("../models/burger");
  
  router.get("/", function (req, res) {
    burger.selectAll(function (data) {
      var burgerObject = {
        burgers: data
      };
      res.render("index", burgerObject);
    });
  });
  
  router.post("/api/burgers", function (req, res) {
    burger.insertOne([
      "burger_name", "devoured"
    ], [
      req.body.burger_name, req.body.devoured
    ], function (result) {
  
      res.json({ id: result.insertId });
    });
  });
  
  router.put("/api/burgers/:id", function (req, res) {
    var condition = "id = " + req.params.id;
  
    burger.updateOne({
      devoured: req.body.devoured
    }, condition, function (result) {
      if (result.changedRows == 0) {
        return res.status(404).end();
      } else {
        res.status(200).end();
      }
    });
  });
  
  router.delete("/api/burgers/:id", function (req, res) {
    var condition = "id = " + req.params.id;
  
    burger.delete(condition, function (result) {
      if (result.affectedRows == 0) {
        return res.status(404).end();
      } else {
        res.status(200).end();
      }
    });
  });
  
  // Export routes for server.js to use.
  module.exports = router;
  