src/google_analytics/ga-router.js
/**
   * The firstMiddleware where the request must go first.
   * Config the request for /ga depending on the params received.
   *
   * @param {any} ctx The context of the request and response.
   * @param {Function} next The next middleware to call.
   * @return {Function} the next middleware()
   *
   */
The firstMiddleware where the request must go first.
Config the request for /ga depending on the params received.

@param {any} ctx The context of the request and response.
@param {Function} next The next middleware to call.
@return {Function} the next middleware()
The firstMiddleware where the request must go first . Config the request for / ga depending on the params received . @param { any } ctx The context of the request and response . @param { Function } next The next middleware to call . @return { Function } the next middleware ()
async configByParams(ctx, next) {
    const dates = Util.getAllDates();
    ctx.state.config = Object.assign(ctx.state.config, {
      'last-start-date': Util.convertDate(dates.firstInPastMonth),
      'last-end-date': Util.convertDate(dates.dateInPastMonth),
      'start-date': Util.convertDate(dates.firstInMonth),
      'end-date': Util.convertDate(dates.today),
    });
    return next();
  }
async configByParams ( ctx , next ) { const dates = Util . getAllDates ( ) ; ctx . state . config = Object . assign ( ctx . state . config , { 'last-start-date' : Util . convertDate ( dates . firstInPastMonth ) , 'last-end-date' : Util . convertDate ( dates . dateInPastMonth ) , 'start-date' : Util . convertDate ( dates . firstInMonth ) , 'end-date' : Util . convertDate ( dates . today ) , } ) ; return next ( ) ; }
The firstMiddleware where the request must go first.
The firstMiddleware where the request must go first .