<commit_before>'use strict';

//Import the dependencies to struct the server-side
var Hapi = require('hapi');
var Path = require('path');
var Logging = require('good');
var Handlebars = require('handlebars');

//Import all config constants
var config = require(Path.join(__dirname, 'config/all'));

console.dir(config);

//Import all the routes for API endpoints
var routes = require(Path.join(__dirname, 'routes/all'));

//Put the current view declerations into server instance
var server = new Hapi.Server({
	app : {
		views : config.views
	}
});

//Connection alias for the Hapi server instance
server.connection({
	host : config.host,
	port : config.port,
	app : config
});

//Initialize routes for the endpoints
server.route(routes);

//Set the variables for view instances
server.views({
  engines: {
    html: require('handlebars')
  },
  path: Path.join(__dirname, server.settings.app.views.path),
  layoutPath: Path.join(__dirname, server.settings.app.views.layoutPath),
  layout: server.settings.app.views.layoutFile,
  helpersPath : Path.join(__dirname, server.settings.app.views.helpersPath),
  partialsPath: Path.join(__dirname, server.settings.app.views.partialsPath)
});

server.route({
  method: 'GET',
  path: '/cdn/{fileName}',
  handler: function (request, reply) {
  	console.log(request.params.fileName);
    reply.file('./cdn/' + request.params.fileName);
  }
});

//Register some logging
server.register({
  register: Logging,
  options: {
    reporters: [{
      reporter: require('good-console'),<commit_msg>added the cookie validation into the cdn directory routes<commit_after>'use strict';

//Import the dependencies to struct the server-side
var Hapi = require('hapi');
var Path = require('path');
var Logging = require('good');
var Handlebars = require('handlebars');

//Import all config constants
var config = require(Path.join(__dirname, 'config/all'));

console.dir(config);

//Import all the routes for API endpoints
var routes = require(Path.join(__dirname, 'routes/all'));

//Put the current view declerations into server instance
var server = new Hapi.Server({
	app : {
		views : config.views
	}
});

//Connection alias for the Hapi server instance
server.connection({
	host : config.host,
	port : config.port,
	app : config
});

//Initialize routes for the endpoints
server.route(routes);

//Set the variables for view instances
server.views({
  engines: {
    html: require('handlebars')
  },
  path: Path.join(__dirname, server.settings.app.views.path),
  layoutPath: Path.join(__dirname, server.settings.app.views.layoutPath),
  layout: server.settings.app.views.layoutFile,
  helpersPath : Path.join(__dirname, server.settings.app.views.helpersPath),
  partialsPath: Path.join(__dirname, server.settings.app.views.partialsPath)
});

server.route({
  method: 'GET',
  path: '/cdn/{fileName}',
  handler: function (request, reply) {
  	console.log(request.params.fileName);
    reply.file('./cdn/' + request.params.fileName);
  },
  config : {
    state: {
      parse: false, // parse and store in request.state
      failAction: 'ignore' // may also be 'ignore' or 'log'
    }
  }
});

//Register some logging
server.register({
  register: Logging,
  options: {
    reporters: [{
      reporter: require('good-console'),
{'fraction_non_alphanumeric': 0.14189396261109408, 'fraction_numerical': 0.0, 'mean_word_length': 4.281553398058253, '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': '7162740', 'n_tokens_mistral': 977, 'n_tokens_neox': 988, 'n_words': 268}