<commit_before>var express = require("express");

var Mustache = require('mustache');
var resumeToText = require('resume-to-text');
var resumeToHTML = require('resume-to-html');
var bodyParser = require('body-parser');
var app = express();
app.use(bodyParser());
var fs = require('fs');
var guid = (function() {
  function s4() {
    return Math.floor((1 + Math.random()) * 0x10000)
               .toString(16)
               .substring(1);
  }
  return function() {
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
           s4() + '-' + s4() + s4() + s4();
  };
})();


MongoClient.connect(process.env.MONGOHQ_URL, function(err, db) {
  app.all('/*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    next();
  });
  app.get('/resume/user/:username.:format', function(req, res) {
  	var resume = JSON.parse(fs.readFileSync(req.params.username + '.json', 'utf8'));
  	console.log(req.params.format);<commit_msg>registration<commit_after>var express = require("express");

var Mustache = require('mustache');
var resumeToText = require('resume-to-text');
var resumeToHTML = require('resume-to-html');
var bodyParser = require('body-parser');

var MongoClient = require('mongodb').MongoClient;
var mongo = require('mongodb');


var app = express();
app.use(bodyParser());
var fs = require('fs');
var guid = (function() {
  function s4() {
    return Math.floor((1 + Math.random()) * 0x10000)
               .toString(16)
               .substring(1);
  }
  return function() {
    return s4() + s4() + '-' + s4() + '-' + s4() + '-' +
           s4() + '-' + s4() + s4() + s4();
  };
})();


MongoClient.connect(process.env.MONGOHQ_URL, function(err, db) {
  app.all('/*', function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "X-Requested-With");
    next();
  });
  app.get('/resume/user/:username.:format', function(req, res) {
  	var resume = JSON.parse(fs.readFileSync(req.params.username + '.json', 'utf8'));
  	console.log(req.params.format);
{'fraction_non_alphanumeric': 0.21455399061032865, 'fraction_numerical': 0.018779342723004695, 'mean_word_length': 3.563169164882227, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '5574774', 'n_tokens_mistral': 744, 'n_tokens_neox': 730, 'n_words': 133}