{"size": 280, "ext": "js", "max_stars_repo_path": "api/middlewares/transaction_id.js", "max_stars_repo_name": "giladgreen/poker-stats-v2", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "api/middlewares/transaction_id.js", "max_issues_repo_name": "giladgreen/poker-stats-v2", "max_issues_repo_issues_event_min_datetime": "2020-07-18T12:53:25.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-27T19:27:28.000Z", "max_forks_repo_path": "api/middlewares/transaction_id.js", "max_forks_repo_name": "giladgreen/poker-stats-v2", "max_forks_repo_forks_event_min_datetime": "2020-01-23T14:14:14.000Z", "max_forks_repo_forks_event_max_datetime": "2020-01-23T14:14:14.000Z"}
{"max_stars_count": null, "max_issues_count": 12, "max_forks_count": 1, "avg_line_length": 20.0, "max_line_length": 60, "alphanum_fraction": 0.6714285714}
const uuid = require('uuid');

function transactionIdMiddlewares(request, response, next) {
  try {
    request.tid = uuid();
    response.setHeader('Transaction-ID', request.tid);
    next();
  } catch (error) {
    next(error);
  }
}

module.exports = transactionIdMiddlewares;
