<commit_before>'use strict'
var dbFunctions = require('../db/seeddb.js')
var mongoose = require('mongoose');
exports = module.exports = function (app) {
  app.get('/', function (req, res) {
    res.render('home')
  })


app.post('/sign-up', function (req, res) {
	var userExists = false
	var db = mongoose.connect('mongodb://localhost:27017/linda');
    dbFunctions.getUsers(db, function (err, users) {
		var newEmail = req.body.email;
    		var userArray = Array.from(users)
    		userArray.forEach(function(user) {
    			if (user.email === newEmail) {
    				console.log(user, "ALREADY EXISTS IN DB!")
    		res.render('home')
    		userExists = true
    	}
    	
    	})
  	if (!userExists) {
  		console.log('Im about to try and save the user')
    	dbFunctions.saveUser(db, req.body, function(err, resp) {
    		console.log('I saved', resp)
    		db.disconnect(function() {
    			res.render('profile', {"user": req.body})
    			console.log('database closed')
    		})
			})
  	}		
  }) 
})
 
  app.get('/lindas', function (req, res) {
    res.render('lindas')
  })

  app.get('/sign-up', function (req, res) {
    res.render('sign-up')
  })
  app.get('/profile', function (req, res) {
  })
<commit_msg>few changes<commit_after>'use strict'
var dbFunctions = require('../db/seeddb.js')
var mongoose = require('mongoose');
exports = module.exports = function (app) {
  app.get('/', function (req, res) {
    res.render('home')
  })


app.post('/sign-up', function (req, res) {
	var userExists = false
	var db = mongoose.connect('mongodb://localhost:27017/linda');
    dbFunctions.getUsers(db, function (err, users) {
		var newEmail = req.body.email;
    		var userArray = Array.from(users)
    		userArray.forEach(function(user) {
    			if (user.email === newEmail) {
    				console.log(user, "ALREADY EXISTS IN DB!")
    		res.render('home')
    		userExists = true
    	}
    })
  	if (!userExists) {
  		console.log('Im about to try and save the user')
    	dbFunctions.saveUser(db, req.body, function(err, resp) {
    		console.log('I saved', resp)
    		db.disconnect(function() {
    			res.render('profile', {"user": req.body})
    			console.log('database closed')
    		})
			})
  	}		
  }) 
})
 
  app.get('/lindas', function (req, res) {
    res.render('lindas')
  })

  app.get('/sign-up', function (req, res) {
    res.render('sign-up')
  })
  app.get('/profile', function (req, res) {
  })

{'fraction_non_alphanumeric': 0.17737256527144632, 'fraction_numerical': 0.004144218814753419, 'mean_word_length': 2.89983844911147, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, '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': '5727265', 'n_tokens_mistral': 909, 'n_tokens_neox': 877, 'n_words': 173}