<commit_before>var express = require('express');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var url = require('url');
var config = require('./config');

var app = express();

app.use(express.static('app'));

app.get('/request_code', function (req, res) {
  res.redirect('https://github.com/login/oauth/authorize?client_id=' + config.clientId);
});

app.get('/request_auth_token', function (req, res) {
  console.log('==== /request_auth_token ====');
  var getAuthTokenUrl = 'https://github.com/login/oauth/access_token?' +
    'client_id=' + config.clientId +
    '&client_secret=' + config.clientSecret +
    '&code=' + req.query.code;

  xhr = new XMLHttpRequest();
  xhr.open('POST', getAuthTokenUrl, false);
  xhr.send();

  var fakeUrl = 'http://fake.uri/?' + xhr.responseText;
  console.log('got auth token: ');
  console.log(url.parse(fakeUrl, true));

  res.redirect('/#' + url.parse(fakeUrl, true).query['access_token']);
});

app.listen(process.env.PORT || 3000);<commit_msg>a log message for server startup<commit_after>var express = require('express');
var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
var url = require('url');
var config = require('./config');

var app = express();

app.use(express.static('app'));

app.get('/request_code', function (req, res) {
  res.redirect('https://github.com/login/oauth/authorize?client_id=' + config.clientId);
});

app.get('/request_auth_token', function (req, res) {
  console.log('==== /request_auth_token ====');
  var getAuthTokenUrl = 'https://github.com/login/oauth/access_token?' +
    'client_id=' + config.clientId +
    '&client_secret=' + config.clientSecret +
    '&code=' + req.query.code;

  xhr = new XMLHttpRequest();
  xhr.open('POST', getAuthTokenUrl, false);
  xhr.send();

  var fakeUrl = 'http://fake.uri/?' + xhr.responseText;
  console.log('got auth token: ');
  console.log(url.parse(fakeUrl, true));

  res.redirect('/#' + url.parse(fakeUrl, true).query['access_token']);
});

port = process.env.PORT || 3000;
app.listen(port);
console.log('Server started. Running on port', port);
{'fraction_non_alphanumeric': 0.1984732824427481, 'fraction_numerical': 0.003816793893129771, 'mean_word_length': 4.9743589743589745, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5534340', 'n_tokens_mistral': 711, 'n_tokens_neox': 696, 'n_words': 128}