src/rpc.js
function getMethod(methodname) {
  if (controllers[methodname]) {
    return function(call, callback) {
      console.log(call);
      return controllers[methodname](call, callback);
    };
  } else {
    return function(call, callback) {
      // By default we print an empty response.
      callback(null, {});
    };
  }
}
function getMethod(methodname) {
  if (controllers[methodname]) {
    return function(call, callback) {
      console.log(call);
      return controllers[methodname](call, callback);
    };
  } else {
    return function(call, callback) {
      // By default we print an empty response.
      callback(null, {});
    };
  }
}
function getMethod ( methodname ) { if ( controllers [ methodname ] ) { return function ( call , callback ) { console . log ( call ) ; return controllers [ methodname ] ( call , callback ) ; } ; } else { return function ( call , callback ) { // By default we print an empty response. callback ( null , { } ) ; } ; } }
Allows us to define methods as we go and hook them up by name to the schemas. It should be possible to determine if a method is streaming or not and get it from a different controller. No maintaining key-value maps!
Allows us to define methods as we go and hook them up by name to the schemas . It should be possible to determine if a method is streaming or not and get it from a different controller . No maintaining key - value maps!