controllers/shapesController.js

/**
 * This controller handles the logic for any shapes related routes.
 * @module Controllers/ShapesController
 */

const ShapeModel = require('../models/shapeModel.js')

/**
 * get all of the shapes
 */
exports.index = (req, res) => {
  // initialize instance of ShapeModel
  const shape = new ShapeModel(req)

  // read the shapes file and send it to client
  shape.getAll(req)
    .then(result => {
      res.send(result)
      // todo add error handling
    })
}