'use strict';

var express = require('express');
var mongoose = require('mongoose');
var port = process.env.PORT || 3000;

var app = express();
app.use(express.static(__dirname + '/public'));

var mongoUri = process.env.MONGO_WISHLIST_APP_URI || 'mongodb://localhost/wishlistApp';

var wishlistRoutes = express.Router();
require('./routes/wishlist-routes')(wishlistRoutes);
app.use('/api', wishlistRoutes);

mongoose.connect(mongoUri, function(err) {
  if (err) console.error('MongoDB connection error:', err);
  else console.log('MongoDB successfully connected to', mongoUri);
});

app.listen(port, function() {
  console.log('Server now listening on port', port, '...');
});

@@ -86,39 +86,146 @@
 var 
-port = process.env.PORT %7C%7C 3000
+bodyParser = require('body-parser');%0Avar port = process.env.PORT %7C%7C 3000;%0Aprocess.env.secret = process.env.secret %7C%7C 'This is not secure!'
 ;%0A%0Av
@@ -293,16 +293,67 @@
 ic'));%0A%0A
+app.use(bodyParser.urlencoded(%7Bextended: true%7D));%0A%0A
 var mong
@@ -525,16 +525,16 @@
 outes);%0A
-
 app.use(
@@ -559,16 +559,235 @@
 utes);%0A%0A
+var authRoutes = express.Router();%0Arequire('./routes/auth-routes')(authRoutes);%0Aapp.use('/auth', authRoutes);%0A%0Avar userRoutes = express.Router();%0Arequire('./routes/user-routes')(userRoutes);%0Aapp.use('/u', userRoutes);%0A%0A
 mongoose

Change /build to /public