<commit_before>
# Application Startup

This code starts up the application.

## Configure

First, include required modules.

    express = require 'express'
    exp3hbs = require 'express3-handlebars'

Next, initialize the application.

    app = express()

Configure HBS to glue Express and Handlebars together with HTML file extensions
for templates.  Also, register a partials directory to pre-load.

    app.set 'view engine', 'html'
    exp3hbs_config =
      defaultLayout: 'default',
      extname: '.html'
    app.engine 'html', exp3hbs(exp3hbs_config)

Configure Express to serve static files.

    app.use express.static('public')

## Routes

Add essential routes.

    app.get '/', (req, res) ->
      res.render 'hello_world', {
        title: 'Hello World'
      }
        

## Startup<commit_msg>add redis session handling<commit_after>
# Application Startup

This code starts up the application.

## Configure

First, include required modules.

    express = require 'express'
    exp3hbs = require 'express3-handlebars'
    redis_store = require('connect-redis')(express)

Next, initialize the application.

    app = express()

Configure HBS to glue Express and Handlebars together with HTML file extensions
for templates.  Also, register a partials directory to pre-load.

    app.set 'view engine', 'html'
    exp3hbs_config =
      defaultLayout: 'default',
      extname: '.html'
    app.engine 'html', exp3hbs(exp3hbs_config)

Configure Express to serve static files.

    app.use express.static('public')

Initialize a session for later use.

    cookie_secret = '<KEY>'
    app.use express.cookieParser(cookie_secret)
    app.use express.session({
      store: new redis_store({host: '127.0.0.1', port: 6379, prefix: 'app-sess'}),
      secret: cookie_secret
    })

## Routes

Add essential routes.

    app.get '/', (req, res) ->
      res.render 'hello_world', {
        title: 'Hello World'
      }

## Startup
{'fraction_non_alphanumeric': 0.1021671826625387, 'fraction_numerical': 0.010319917440660475, 'mean_word_length': 3.215217391304348, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '1500876', 'n_tokens_mistral': 598, 'n_tokens_neox': 580, 'n_words': 186}