
/**
 * Module dependencies.
 */

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

/* For AB Testing */
var home2 = require('./routes/home2');
var myUploads2 = require('./routes/myUploads2');
var profile2 = require('./routes/profile2');
var quests2 = require('./routes/quests2');
var upload2 = require('./routes/upload2');

var feed = require('./routes/feed');
var home = require('./routes/home');
var login = require('./routes/login');
var myUploads = require('./routes/myUploads');
var newuser = require('./routes/newuser');
var profile = require('./routes/profile');
var quests = require('./routes/quests');
var upload = require('./routes/upload');
// Example route
// var user = require('./routes/user');

var app = express();


// app.engine('html', handlebars({extname:'html'}));
// app.set('view engine', 'html');
// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.engine('html', handlebars({extname:'html'}));
app.set('view engine', 'html');
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('/', function(req,res){
	res.render('landing')
});
app.get('/home', home.view);
app.post('/home', newuser.createUser);
app.get('/feed', feed.view);
app.get('/login', login.view);
app.get('/profile', profile.view);
app.get('/myUploads', myUploads.view);
app.get('/quests', quests.view);
app.get('/upload', upload.view);
app.get('/settings', function(req,res){
	res.render('settings')
});
app.post('/uploadComplete', upload.uploadPicture);
app.get('/newuser', function(req, res){
	res.render('newuser');
});
// app.get('/newUser/createAccount', newUser.createAccount);
// app.post('/newUser/createAccount', newUser.createAccount);
app.get('/landing', function(req,res){
	res.render('landing')
});
// Example route
// app.get('/users', user.list);

/* For AB Testing */
app.get('/home2', home2.view);
app.get('/myUploads2', myUploads2.view);
app.get('/profile2', profile2.view);
app.get('./quests2', quests2.view);
app.get('./upload2', upload2.view);
app.post('/uploadComplete2', upload2.uploadPicture);

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

@@ -575,17 +575,17 @@
 %0Avar new
-u
+U
 ser = re
@@ -599,25 +599,25 @@
 ./routes/new
-u
+U
 ser');%0Avar p
@@ -1637,17 +1637,17 @@
 me', new
-u
+U
 ser.crea
@@ -1998,53 +1998,20 @@
 r', 
-function(req, res)%7B%0A%09res.render('newuser');%0A%7D
+newUser.view
 );%0A/

Revert "Fixed a typo with app.js (newUser -> newuser)"