<commit_before>var port = process.env.PORT || 4000,
    app = require('./app').init(port),
    utils = require('./utils'),
    conf = require('./conf'),
    request = require('request'),
    pageSize = 20;
   
    
app.get('/', function(req, res){

    request.get({url:'/api/templates',json:true},function(e,r,b){
         
        res.render("index",{templates:b.templates,utils:utils});
         
    });
    
});

app.get('/api/templates', function(req, res){
    var fs = require('fs');
    
    //fs.readFile('./static/templates.json', 'utf8', function (err, data) {
    //    res.json(data);
    //});
    
    //var fileJSON = require('./static/templates.json');
    //res.send(fileJSON);

    fs.readFileSync('./templates.json', 'utf8', function (err, data) {
        res.json(data);
    });
    
    //fs.createReadStream('templates.json').pipe(res);
    
});

    <commit_msg>fix json<commit_after>var port = process.env.PORT || 4000,
    app = require('./app').init(port),
    utils = require('./utils'),
    conf = require('./conf'),
    request = require('request'),
    pageSize = 20;
   
    
app.get('/', function(req, res){

    request.get({url:'/api/templates',json:true},function(e,r,b){
         
        res.render("index",{templates:b.templates,utils:utils});
         
    });
    
});

app.get('/api/templates', function(req, res){
    var fs = require('fs');
    
    //fs.readFile('./static/templates.json', 'utf8', function (err, data) {
    //    res.json(data);
    //});
    
    //var fileJSON = require('./static/templates.json');
    //res.send(fileJSON);

    fs.readFile('./templates.json', 'utf8', function (err, data) {
        res.send(JSON.parse(data));
    });
    
    //fs.createReadStream('templates.json').pipe(res);
    
});

    
{'fraction_non_alphanumeric': 0.21665728756330896, 'fraction_numerical': 0.009003939223410242, 'mean_word_length': 2.4794520547945207, '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': '1809902', 'n_tokens_mistral': 593, 'n_tokens_neox': 574, 'n_words': 85}