{"size": 737, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "maichong/alaska-commission", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "maichong/alaska-commission", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "maichong/alaska-commission", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.03125, "max_line_length": 60, "alphanum_fraction": 0.6173677069}
/**
 * @copyright Maichong Software Ltd. 2016 http://maichong.it
 * @date 2016-04-19
 * @author Liang <liang@maichong.it>
 */

import alaska from 'alaska';

class CommissionService extends alaska.Service {
  constructor(options, alaska) {
    options = options || {};
    options.dir = options.dir || __dirname;
    options.id = options.id || 'alaska-commission';
    super(options, alaska);
  }

  postLoadConfig() {
    alaska.main.applyConfig({
      '+appMiddlewares': [{
        id: __dirname + '/middlewares/promoter.js',
        sort: 0,
        options: {
          queryKey: this.config('queryKey'),
          cookieOptions: this.config('cookieOptions')
        }
      }]
    });
  }
}

export default new CommissionService();
