<commit_before>"use strict";

var Express = require('express');
var http = require('http');
var https = require('https');
var path = require('path');
var fs = require('fs');
const TARGET_API = process.env.TARGET_API || 'ovp';
const STATIC_DIR = __dirname + '/generated/' + TARGET_API;
const DEFAULT_INDEX = fs.readFileSync(path.join(STATIC_DIR, 'default_index.html'), 'utf8');

var App = Express();
App.use(require('compression')());
if (process.env.ENABLE_CROSS_ORIGIN) {
  App.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
}

if (process.env.USE_BASIC_AUTH && process.env.LUCYBOT_USERNAME && process.env.LUCYBOT_PASSWD) {
  App.use(require('./routes/basic-auth.js'));
}

if (process.env.ENABLE_HOMEPAGE) {
  App.use('/homepage', Express.static(__dirname + '/homepage'));
  App.engine('pug', require('pug').__express);
  App.set('view engine', 'pug')
  App.set('views', __dirname + '/homepage/views');
  App.get('/', (req, res) => {
    res.render('index', {}, (err, html) => {
      if (err) res.status(500).send(err.toString());
      res.send(html);
    });
  })
}
<commit_msg>make ENABLE_HOMEPAGE flag more specific<commit_after>"use strict";

var Express = require('express');
var http = require('http');
var https = require('https');
var path = require('path');
var fs = require('fs');
const TARGET_API = process.env.TARGET_API || 'ovp';
const STATIC_DIR = __dirname + '/generated/' + TARGET_API;
const DEFAULT_INDEX = fs.readFileSync(path.join(STATIC_DIR, 'default_index.html'), 'utf8');

var App = Express();
App.use(require('compression')());
if (process.env.ENABLE_CROSS_ORIGIN) {
  App.use(function(req, res, next) {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
    next();
  });
}

if (process.env.USE_BASIC_AUTH && process.env.LUCYBOT_USERNAME && process.env.LUCYBOT_PASSWD) {
  App.use(require('./routes/basic-auth.js'));
}

if (process.env.ENABLE_HOMEPAGE === 'true') {
  App.use('/homepage', Express.static(__dirname + '/homepage'));
  App.engine('pug', require('pug').__express);
  App.set('view engine', 'pug')
  App.set('views', __dirname + '/homepage/views');
  App.get('/', (req, res) => {
    res.render('index', {}, (err, html) => {
      if (err) res.status(500).send(err.toString());
      res.send(html);
    });
  })
}

{'fraction_non_alphanumeric': 0.20798403193612774, 'fraction_numerical': 0.0031936127744510976, 'mean_word_length': 4.760919540229885, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2031834', 'n_tokens_mistral': 884, 'n_tokens_neox': 882, 'n_words': 155}