<commit_before>var express = require('express');
var router = express.Router();
var config = require('../config.js');
// moment to parse time
var moment = require('moment');

/* GET home page. */
router.get('/', function(req, res) {
  res.render('index', { title: 'api.lukemil.es' });
});

router.get('/v1/', function(req, res) {
	// calculate age with moment
	age = moment().diff(config.me.birthDate, 'years', true);
	// delete birthdate from array
    res.json({
    	status: 200,
        name: config.me.name,
        age: age,
        interests: config.me.interests,
        location: config.me.location,
        endpoints: ['/v1/github', '/v1/github/contributions', '/v1/github/last', '/v1/music', '/v1/music/recent', '/v1/music/weekly', '/v1/sleep', '/v1/walking']
    });
});

module.exports = router;<commit_msg>add CSRF header for /v1/<commit_after>var express = require('express');
var router = express.Router();
var config = require('../config.js');
// moment to parse time
var moment = require('moment');

/* GET home page. */
router.get('/', function(req, res) {
  res.render('index', { title: 'api.lukemil.es' });
});

router.get('/v1/', function(req, res) {
    res.setHeader("Access-Control-Allow-Origin", "*");
	// calculate age with moment
	age = moment().diff(config.me.birthDate, 'years', true);
	// delete birthdate from array
    res.json({
    	status: 200,
        name: config.me.name,
        age: age,
        interests: config.me.interests,
        location: config.me.location,
        endpoints: ['/v1/github', '/v1/github/contributions', '/v1/github/last', '/v1/music', '/v1/music/recent', '/v1/music/weekly', '/v1/sleep', '/v1/walking']
    });
});

module.exports = router;
{'fraction_non_alphanumeric': 0.2033997655334115, 'fraction_numerical': 0.014654161781946073, 'mean_word_length': 3.235732009925558, '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': '4690480', 'n_tokens_mistral': 593, 'n_tokens_neox': 573, 'n_words': 128}