<commit_before>import express from 'express';
import bodyParser from 'body-parser'
import dirsortjs from './logic'
import path from 'path';
import http from 'http';
import Promise from 'bluebird';
import configHelper from './api/configHelper.js'

let app = express();

app.set('views', path.join(__dirname, '../views'));
app.set('view engine', 'jade');
app.set('view options', {
  layout: false
});

app.use(express.static(path.join(__dirname, '../client/')));

app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));



http.createServer(app).listen('8151', () => {
  console.log('Express server listening on port ' + 8151);
});

require('./routes')(app);

app.get('/', function (req, res) {

  configHelper.get().then(config => {
    res.render('content', {layout: 'layout', folders: config});
  });
});

app.get('/overview', function (req, res) {

  res.render('overview', {layout: 'layout'});
});

app.get('/folders', function (req, res) {

  configHelper.get().then(config => {
    res.render('folders', {layout: 'layout', folders: config});
  });
});

app.get('/add/folder', function (req, res) {

  res.render('add_folder', {layout: 'layout'});
});
<commit_msg>refactor code<commit_after>import express from 'express';
import bodyParser from 'body-parser'
import dirsortjs from './logic'
import path from 'path';
import http from 'http';
import Promise from 'bluebird';
import configHelper from './api/configHelper.js'

let app = express();

app.set('views', path.join(__dirname, '../views'));
app.set('view engine', 'jade');
app.set('view options', {
  layout: false
});

app.use(express.static(path.join(__dirname, '../client/')));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

http.createServer(app).listen('8151', () => {
  console.log('Express server listening on port ' + 8151);
});

require('./routes')(app);

app.get('/', function (req, res) {

  configHelper.get().then(config => {
    res.render('content', {layout: 'layout', folders: config});
  });
});

app.get('/overview', function (req, res) {

  res.render('overview', {layout: 'layout'});
});

app.get('/folders', function (req, res) {

  configHelper.get().then(config => {
    res.render('folders', {layout: 'layout', folders: config});
  });
});

app.get('/add/folder', function (req, res) {

  res.render('add_folder', {layout: 'layout'});
});

{'fraction_non_alphanumeric': 0.21821233738984475, 'fraction_numerical': 0.006714225765841376, 'mean_word_length': 4.974937343358396, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '6766779', 'n_tokens_mistral': 792, 'n_tokens_neox': 767, 'n_words': 179}