<commit_before>'use strict';

var path             =  require('path');
var fs               =  require('fs');
var Handlebars       =  require('handlebars');
var express          =  require('express');
var hyperwatch       =  require('hyperwatch');

var registerPartials =  require('./register-partials');
var dirs             =  require('../../config/directories');
var launchPhantomJS  =  require('./../launch-phantomjs');

var build =  require('./../build');
var app   =  require('./app');

var go = module.exports = function (pagesOpts, buildOpts) {

  app.use(express.logger('dev'));

  app.set('view engine', 'hbs');

  // serve the index file given to us by the app
  // it needs to include our partials in order to be setup correctly
  app.get('/', function (req, res, next) {

    // recompile template on every refresh in development to reflect any changes to ie
    fs.readFile(pagesOpts.index, 'utf8', function (err, tmpl) {
      if (err) return next(err);
      res.set({ 'Content-Type': 'text/html' });
      var html = Handlebars.compile(tmpl)(pagesOpts.context);
      res.send(200, html);
    });
  });

  // serve the bundle that we require in our script-body-js template
  app.get('/bundle.js', function (req, res, next) {
    build(buildOpts, function (err, bundle) {
      if (err) return next(err);
      res.setHeader('Content-Type', 'application/javascript');
      res.send(200, bundle);
    });
  });

  var server = app.listen(pagesOpts.port);
  server
    .on('listening', function () {<commit_msg>starting to phase out bootstrap<commit_after>'use strict';

var path             =  require('path');
var fs               =  require('fs');
var Handlebars       =  require('handlebars');
var express          =  require('express');
var hyperwatch       =  require('hyperwatch');

var registerPartials =  require('./register-partials');
var dirs             =  require('../../config/directories');
var launchPhantomJS  =  require('./../launch-phantomjs');

var build =  require('./../build');
var app   =  require('./app');

var go = module.exports = function (pagesOpts, buildOpts) {

  app.use(express.logger('dev'));

  app.set('view engine', 'hbs');

  // serve the bundle that we require in our script-body-js template
  app.get('/bundle.js', function (req, res, next) {
    build(buildOpts, function (err, bundle) {
      if (err) return next(err);
      res.setHeader('Content-Type', 'application/javascript');
      res.send(200, bundle);
    });
  });

  var server = app.listen(pagesOpts.port);
  server
    .on('listening', function () {
{'fraction_non_alphanumeric': 0.16290824261275272, 'fraction_numerical': 0.0038880248833592537, 'mean_word_length': 2.9402756508422665, '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': '4871057', 'n_tokens_mistral': 773, 'n_tokens_neox': 758, 'n_words': 211}