index.js
function (method, view, locals, cb) {
    if (typeof locals === 'function') {
      cb = locals;
      locals = {};
    }

    this.lazyRouter();
    view.options = view.options || {};
    view.options.handled = view.options.handled || [];

    if (typeof cb !== 'function') {
      cb = this.handleError(method, view);
    }

    view.options.method = method;
    view.options.handled.push(method);
    if (view.emit) {
      view.emit('handle', method);
    }

    this.router.handle(view, function (err) {
      if (err) return cb(err);
      cb(null, view);
    });
  }
function (method, view, locals, cb) {
    if (typeof locals === 'function') {
      cb = locals;
      locals = {};
    }

    this.lazyRouter();
    view.options = view.options || {};
    view.options.handled = view.options.handled || [];

    if (typeof cb !== 'function') {
      cb = this.handleError(method, view);
    }

    view.options.method = method;
    view.options.handled.push(method);
    if (view.emit) {
      view.emit('handle', method);
    }

    this.router.handle(view, function (err) {
      if (err) return cb(err);
      cb(null, view);
    });
  }
function ( method , view , locals , cb ) { if ( typeof locals === 'function' ) { cb = locals ; locals = { } ; } this . lazyRouter ( ) ; view . options = view . options || { } ; view . options . handled = view . options . handled || [ ] ; if ( typeof cb !== 'function' ) { cb = this . handleError ( method , view ) ; } view . options . method = method ; view . options . handled . push ( method ) ; if ( view . emit ) { view . emit ( 'handle' , method ) ; } this . router . handle ( view , function ( err ) { if ( err ) return cb ( err ) ; cb ( null , view ) ; } ) ; }
Handle middleware for the given `view` and locals.

```js
app.handle('customHandle', view);
```

@name .handle
@param {String} `method` Router VERB
@param {Object} `view` View object
@param {Object} `locals`
@param {Function} `cb`
@return {Object}
@api public
Handle middleware for the given view and locals .