controller.js
function() {
    // Routes
    this.routes = {
      all: {},
      get: {},
      post: {},
      put: {},
      patch: {},
      delete: {}
    };

    // Middleware(s)
    this.pre = []; // run before route middleware
    this.before = []; // run after route middleware but before route handler
    this.after = []; // run after route handler

    // Setup middleware and route handlers
    this.setupPreMiddleware();
    this.setupBeforeMiddleware();
    this.setupRoutes();
    this.setupAfterMiddleware();

    // Response/error handler middleware
    this.after.push(this.successResponse);
    this.after.push(this.errorResponse);
    this.after.push(this.finalResponse);
  }
function() {
    // Routes
    this.routes = {
      all: {},
      get: {},
      post: {},
      put: {},
      patch: {},
      delete: {}
    };

    // Middleware(s)
    this.pre = []; // run before route middleware
    this.before = []; // run after route middleware but before route handler
    this.after = []; // run after route handler

    // Setup middleware and route handlers
    this.setupPreMiddleware();
    this.setupBeforeMiddleware();
    this.setupRoutes();
    this.setupAfterMiddleware();

    // Response/error handler middleware
    this.after.push(this.successResponse);
    this.after.push(this.errorResponse);
    this.after.push(this.finalResponse);
  }
function ( ) { // Routes this . routes = { all : { } , get : { } , post : { } , put : { } , patch : { } , delete : { } } ; // Middleware(s) this . pre = [ ] ; // run before route middleware this . before = [ ] ; // run after route middleware but before route handler this . after = [ ] ; // run after route handler // Setup middleware and route handlers this . setupPreMiddleware ( ) ; this . setupBeforeMiddleware ( ) ; this . setupRoutes ( ) ; this . setupAfterMiddleware ( ) ; // Response/error handler middleware this . after . push ( this . successResponse ) ; this . after . push ( this . errorResponse ) ; this . after . push ( this . finalResponse ) ; }
Called after the constructor
Called after the constructor