They should be placed in the include that you require from each route.
common.js
function Common(){} Common.prototype.method1 = function(){} Common.prototype.method2 = function(){} module.exports = new Common();
route.js
var common = require('./common'); common.method1(); common.method2();
source share