lib/handlers.js
function addPathToExpress(handlerObj, handlePath) {
  var self = handlerObj;
  //Check to make sure that the module exists and will load properly to what node expects
  if (moduleExists.call(self, handlePath)) {
    //retrieve the http verbs defined in the handler files and then add to the swagger server
    var handleVerbs = require(handlePath);

    //Get the route path by removing the ./handlers and the .js file extension
    //TODO: Use path names to get these
    var routePath = handlePath.replace(/.*\/handlers/, '');
    routePath = routePath.replace(/\.js/, '');

    swaggerMethods.forEach(function(method) {
      if (handleVerbs[method] && validSwaggerize(self, handleVerbs[method])) {
        self.server[method](routePath, handleVerbs[method]);
      }
    });
  }
}
function addPathToExpress(handlerObj, handlePath) {
  var self = handlerObj;
  //Check to make sure that the module exists and will load properly to what node expects
  if (moduleExists.call(self, handlePath)) {
    //retrieve the http verbs defined in the handler files and then add to the swagger server
    var handleVerbs = require(handlePath);

    //Get the route path by removing the ./handlers and the .js file extension
    //TODO: Use path names to get these
    var routePath = handlePath.replace(/.*\/handlers/, '');
    routePath = routePath.replace(/\.js/, '');

    swaggerMethods.forEach(function(method) {
      if (handleVerbs[method] && validSwaggerize(self, handleVerbs[method])) {
        self.server[method](routePath, handleVerbs[method]);
      }
    });
  }
}
function addPathToExpress ( handlerObj , handlePath ) { var self = handlerObj ; //Check to make sure that the module exists and will load properly to what node expects if ( moduleExists . call ( self , handlePath ) ) { //retrieve the http verbs defined in the handler files and then add to the swagger server var handleVerbs = require ( handlePath ) ; //Get the route path by removing the ./handlers and the .js file extension //TODO: Use path names to get these var routePath = handlePath . replace ( / .*\/handlers / , '' ) ; routePath = routePath . replace ( / \.js / , '' ) ; swaggerMethods . forEach ( function ( method ) { if ( handleVerbs [ method ] && validSwaggerize ( self , handleVerbs [ method ] ) ) { self . server [ method ] ( routePath , handleVerbs [ method ] ) ; } } ) ; } }
Add the handlePath to the Swagger Express server if valid
@param handlePath
Add the handlePath to the Swagger Express server if valid