demo/homePage/homePage.js
function(req, res) {
      this.debug('preProcessor called');

      // MAGIC ALERT: if no templateName is specified the framework looks for [module name].[template extension] (default=.jade)

      // example of specifying nodule properties at request time
      if (req.path.indexOf('special') > -1) {
        this.apiCalls[1].params = {isSpecial: true}; // add extra param to existing API call
        this.templateName = 'altHomePage.jade';      // select alternate template
      }
    }
function(req, res) {
      this.debug('preProcessor called');

      // MAGIC ALERT: if no templateName is specified the framework looks for [module name].[template extension] (default=.jade)

      // example of specifying nodule properties at request time
      if (req.path.indexOf('special') > -1) {
        this.apiCalls[1].params = {isSpecial: true}; // add extra param to existing API call
        this.templateName = 'altHomePage.jade';      // select alternate template
      }
    }
function ( req , res ) { this . debug ( 'preProcessor called' ) ; // MAGIC ALERT: if no templateName is specified the framework looks for [module name].[template extension] (default=.jade) // example of specifying nodule properties at request time if ( req . path . indexOf ( 'special' ) > - 1 ) { this . apiCalls [ 1 ] . params = { isSpecial : true } ; // add extra param to existing API call this . templateName = 'altHomePage.jade' ; // select alternate template } }
business logic before API calls are made
business logic before API calls are made