<commit_before>
/**
 * Module dependencies.
 */

var express = require('express');
var http = require('http');
var path = require('path');
var handlebars = require('express3-handlebars')
var mongoose = require('mongoose');


var tasks = require('./routes/tasks');
var rewards = require('./routes/rewards');
var add = require('./routes/addtask');
var addreward = require('./routes/addreward');
var notif = require('./routes/notifications');
var settings = require('./routes/settings');
var createTask = require('./routes/createTask');
// Example route
// var user = require('./routes/user');

var local_database_name = 'choredb';
var local_database_uri  = 'mongodb://localhost/' + local_database_name
var database_uri = process.env.MONGOLAB_URI || local_database_uri
mongoose.connect(database_uri);

var app = express();

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.engine('handlebars', handlebars());
app.set('view engine', 'handlebars');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.cookieParser('Intro HCI secret key'));
app.use(express.session());
app.use(app.router);
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

// Add routes here
app.get('/', tasks.view);
app.get('/addtask', add.view);
app.get('/rewards/add', addreward.view);
app.get('/rewards', rewards.view);
app.get('/notifications', notif.view);
app.get('/settings', settings.view);
app.post('/maketask', createTask.handle);

// Example route
// app.get('/users', user.list);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});
<commit_msg>Added login screen, still lacks coherent build into the rest of the site<commit_after>
/**
 * Module dependencies.
 */

var express = require('express');
var http = require('http');
var path = require('path');
var handlebars = require('express3-handlebars')
var mongoose = require('mongoose');
var passport = require('passport');
var strategy = require('./setup-passport');

var tasks = require('./routes/tasks');
var rewards = require('./routes/rewards');
var add = require('./routes/addtask');
var addreward = require('./routes/addreward');
var notif = require('./routes/notifications');
var settings = require('./routes/settings');
var createTask = require('./routes/createTask');

// Example route
// var user = require('./routes/user');

var local_database_name = 'choredb';
var local_database_uri  = 'mongodb://localhost/' + local_database_name
var database_uri = process.env.MONGOLAB_URI || local_database_uri
mongoose.connect(database_uri);

var app = express();

// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.engine('handlebars', handlebars());
app.set('view engine', 'handlebars');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(express.cookieParser('Intro HCI secret key'));
app.use(express.session());
  app.use(passport.initialize());
  app.use(passport.session());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));

  
// development only
if ('development' == app.get('env')) {
  app.use(express.errorHandler());
}

// Add routes here
app.get('/', tasks.view);
app.get('/addtask', add.view);
app.get('/addreward', addreward.view);
app.get('/login', function(req, res){
	res.render('login');
}
app.get('/rewards', rewards.view);
app.get('/notifications', notif.view);
app.get('/settings', settings.view);
app.post('/maketask', createTask.handle);
app.get('/callback', 
		passport.authenticate('auth0', { failureRedirect: '/404' }), 
 		function(req, res) {
    		if (!req.user) {
   				throw new Error('user null');
   			}
			res.redirect("/");
 		 }
);

// Example route
// app.get('/users', user.list);

http.createServer(app).listen(app.get('port'), function(){
  console.log('Express server listening on port ' + app.get('port'));
});

{'fraction_non_alphanumeric': 0.2025375939849624, 'fraction_numerical': 0.003289473684210526, 'mean_word_length': 5.36322869955157, 'pattern_counts': {'":': 0, '<': 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': '2411827', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1341, 'n_words': 277}