function format(path) {
  var obj = require(path);
  return function(req, res){
    res.format(obj);
  };
}
function format(path) {
  var obj = require(path);
  return function(req, res){
    res.format(obj);
  };
}
function format ( path ) { var obj = require ( path ) ; return function ( req , res ) { res . format ( obj ) ; } ; }
or you could write a tiny middleware like this to add a layer of abstraction and make things a bit more declarative:
or you could write a tiny middleware like this to add a layer of abstraction and make things a bit more declarative :
Returns a function that formats the given object.