<commit_before>const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const contactRoutes = require('./routes/contactsRouter');
const userRoutes = require('./routes/usersRouter');
const app = express();

// Use body-parser middleware
app.use(bodyParser.json());

// Use Express Router
app.use('/api/contacts', contactRoutes);
app.use('/api/users', userRoutes);

// Create database variable outside of the connection
var db;

// Connect to mongoose (Change the URI or localhost path for mongodb as needed)
mongoose.connect(process.env.MONGODB_URI || 'mongodb://achowdhury2015:<EMAIL>:25263/achowdhury-mean-contact', {
	useMongoClient: true
}, function(err) {

	// Exit process if unable to connect to db
	if (err) {
		console.log(err);
		process.exit(1);
	}

	// Save databse object
	db = mongoose.connection;
	console.log("Database connection ready");

	// Serve the app
	var server = app.listen(process.env.PORT || 8080, function() {
		var port = server.address().port;
		console.log("App now running on port", port);
	});
});

// API home
app.get('/', function(req, res) {
	res.send('Use /api/contacts, or /api/users');<commit_msg>Prepare to push repo into Github by changing database URI<commit_after>const express = require('express');
const bodyParser = require('body-parser');
const mongoose = require('mongoose');
const contactRoutes = require('./routes/contactsRouter');
const userRoutes = require('./routes/usersRouter');
const app = express();

// Use body-parser middleware
app.use(bodyParser.json());

// Use Express Router
app.use('/api/contacts', contactRoutes);
app.use('/api/users', userRoutes);

// Create database variable outside of the connection
var db;

// Connect to mongoose (Change the URI or localhost path for mongodb as needed)
mongoose.connect(process.env.MONGODB_URI || 'Database address go here', {
	useMongoClient: true
}, function(err) {

	// Exit process if unable to connect to db
	if (err) {
		console.log(err);
		process.exit(1);
	}

	// Save databse object
	db = mongoose.connection;
	console.log("Database connection ready");

	// Serve the app
	var server = app.listen(process.env.PORT || 8080, function() {
		var port = server.address().port;
		console.log("App now running on port", port);
	});
});

// API home
app.get('/', function(req, res) {
	res.send('Use /api/contacts, or /api/users');
{'fraction_non_alphanumeric': 0.15191986644407346, 'fraction_numerical': 0.007929883138564273, 'mean_word_length': 4.523041474654378, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '426572', 'n_tokens_mistral': 773, 'n_tokens_neox': 751, 'n_words': 215}