old_contents: 'use strict';
  
  // Module dependencies.
  var express = require('express'),
      path = require('path'),
      fs = require('fs'),
      methodOverride = require('method-override'),
      morgan = require('morgan'),
      bodyParser = require('body-parser'),
      errorhandler = require('errorhandler');
  
  var app = module.exports = exports.app = express();
  
  app.locals.siteName = "MongooseGettingStarted";
  
  // Connect to database
  var db = require('./config/db');
  
  app.use(express.static(__dirname + '/public'));
  
  // Bootstrap models
  var modelsPath = path.join(__dirname, 'models');
  fs.readdirSync(modelsPath).forEach(function (file) {
      require(modelsPath + '/' + file);
  });
  
  var env = process.env.NODE_ENV || 'development';
  
  if ('development' == env) {
      app.use(morgan('dev'));
      app.use(errorhandler({
          dumpExceptions: true,
          showStack: true
      }));
      app.set('view options', {
          pretty: true
      });
  }
  
  
  if ('test' == env) {
      app.use(morgan('test'));
      app.set('view options', {
          pretty: true
      });
  }
  
  if ('production' == env) {
      app.use(morgan());
      app.use(express.errorHandler());
  }
  
  
  
  app.engine('html', require('ejs').renderFile);
  app.set('view engine', 'html');
  app.use(methodOverride());
  app.use(bodyParser());
  // Router needs to be last
  //app.use(app.router);
  
  // Bootstrap routes/api
  var routesPath = path.join(__dirname, 'routes');
  fs.readdirSync(routesPath).forEach(function (file) {
      require(routesPath + '/' + file)(app);
  });
  
  // Start server
  var port = process.env.PORT || 3000;
  app.listen(port, function () {
      console.log('Express server listening on port %d in %s mode', port, app.get('env'));
  });
new_contents: 'use strict';
  
  // Module dependencies.
  var express = require('express'),
      path = require('path'),
      fs = require('fs'),
      methodOverride = require('method-override'),
      morgan = require('morgan'),
      bodyParser = require('body-parser'),
      errorhandler = require('errorhandler');
  
  var app = module.exports = exports.app = express();
  
  app.locals.siteName = "<%= _.capitalize(appname) %>";
  
  // Connect to database
  var db = require('./config/db');
  
  // Bootstrap models
  var modelsPath = path.join(__dirname, 'models');
  fs.readdirSync(modelsPath).forEach(function (file) {
    require(modelsPath + '/' + file);
  });
  
  var env = process.env.NODE_ENV || 'development';
  
  if ('development' == env) {
      app.use(morgan('dev'));
      app.use(errorhandler({
          dumpExceptions: true,
          showStack: true
      }));
      app.set('view options', {
          pretty: true
      });
  }
  
  if ('test' == env) {
      app.use(morgan('test'));
      app.set('view options', {
          pretty: true
      });
  }
  
  if ('production' == env) {
      app.use(morgan());
      app.use(express.errorHandler());
  }
  
  app.engine('html', require('ejs').renderFile);
  app.set('view engine', 'html');
  app.use(methodOverride());
  app.use(bodyParser());
  
  // Bootstrap routes/api
  var routesPath = path.join(__dirname, 'routes');
  fs.readdirSync(routesPath).forEach(function(file) {
    require(routesPath + '/' + file)(app);
  });
  
  // Start server
  var port = process.env.PORT || 3000;
  app.listen(port, function () {
    console.log('Express server listening on port %d in %s mode', port, app.get('env'));
  });
subject: Update the code base as per expressjs 4.0