<commit_before>const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const cors = require('cors');
const passport = require('passport');
const mongoose = require('mongoose');
const config = require('./config/database');

// Database connection
mongoose.connect(config.database);

// On Connection
mongoose.connection.on('connected', () => {
	console.log('Connected to database ' + config.database);
});

// On Error
mongoose.connection.on('error', (err) => {
	console.log('Database error: ' + err);
});


const app = express();

const algorithms = require('./routes/app');

// Port Number
const port = 3000;

// CORS Middleware
app.use(cors());

// Set Static Folder
app.use(express.static(path.join(__dirname, 'public')));

// Body Parser Middleware
app.use(bodyParser.json());

app.use('/index', algorithms);

// Index Route
app.get('/', (req, res) => {
	res.send('Beautiful Algorithms Project');
});

// Start Server
app.listen(port, () => {
	console.log('Server started on port ' + 3000);
});
<commit_msg>Fixed server error<commit_after>/* https://www.youtube.com/watch?v=DQ9pZ2NKXRo 
   https://www.youtube.com/watch?v=OILrJmjkId4	
*/

const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
const cors = require('cors');
const passport = require('passport');

const app = express();

// Port Number
const port = 3000;

// CORS Middleware
app.use(cors());

// Set Public Folder
app.use(express.static(path.join(__dirname, 'public')));

// Body Parser Middleware
app.use(bodyParser.json());

// Index Route
app.get('/', (req, res) => {
	res.send('Beautiful Algorithms Project');
});

app.get('*', (req, res) => {
	res.sendFile(path.join(__dirname, 'public/index.html'));
});

// Start Server
app.listen(port, () => {
	console.log('Server started on port ' + port);
});


{'fraction_non_alphanumeric': 0.19553666312433582, 'fraction_numerical': 0.007970244420828906, 'mean_word_length': 4.723404255319149, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 10, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '147379', 'n_tokens_mistral': 625, 'n_tokens_neox': 608, 'n_words': 140}