<commit_before>/*
eslint-disable no-console
*/
var path = require('path');
var express = require('express');
var session = require('express-session');
var serveStatic = require('serve-static');
var compression = require('compression');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var passport = require('passport');
var appPort = process.env.PORT || 8080;
var app = express();

var settings = {
  cookieSecret: require('crypto').randomBytes(64).toString('hex'),
  folderLocation:  path.resolve(__dirname, '../service/database/data')
};
// console.log({
//   settings
// });

var useFileStore = true;
var store = ((sess) => {
	if(useFileStore){
		const FileStore = require('session-file-store')(session);
		const fileStoreOptions = {
			path: settings.folderLocation
		};
		const store = new FileStore(fileStoreOptions)
		return store;
	}

	var MongoDBStore = require('connect-mongodb-session')(sess);
	const connectErrorCallback = (error) => {
		if(error) {
			console.log({ mongoConnectError: error});
		}
	};
	var store = new MongoDBStore({
		uri: 'mongodb://ubuntu:27017',
		databaseName: 'cents',
		collection: 'sessions'
	}, connectErrorCallback);

	store.on('error', connectErrorCallback);
	return store;<commit_msg>Update index.js<commit_after>/*
eslint-disable no-console
*/
var path = require('path');
var express = require('express');
var session = require('express-session');
var serveStatic = require('serve-static');
var compression = require('compression');
var bodyParser = require('body-parser');
var cookieParser = require('cookie-parser');
var passport = require('passport');
var appPort = process.env.PORT || 8080;
var app = express();

var settings = {
  cookieSecret: process.env.COOKIE_SECRET || require('crypto').randomBytes(64).toString('hex'),
  folderLocation:  path.resolve(__dirname, '../service/database/data')
};
// console.log({
//   settings
// });

var useFileStore = true;
var store = ((sess) => {
	if(useFileStore){
		const FileStore = require('session-file-store')(session);
		const fileStoreOptions = {
			path: settings.folderLocation
		};
		const store = new FileStore(fileStoreOptions)
		return store;
	}

	var MongoDBStore = require('connect-mongodb-session')(sess);
	const connectErrorCallback = (error) => {
		if(error) {
			console.log({ mongoConnectError: error});
		}
	};
	var store = new MongoDBStore({
		uri: 'mongodb://ubuntu:27017',
		databaseName: 'cents',
		collection: 'sessions'
	}, connectErrorCallback);

	store.on('error', connectErrorCallback);
	return store;
{'fraction_non_alphanumeric': 0.1621727237202032, 'fraction_numerical': 0.008597108245408363, 'mean_word_length': 5.139088729016787, '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': '755891', 'n_tokens_mistral': 836, 'n_tokens_neox': 772, 'n_words': 177}