Controller.js class, converted to a node.js module