text: var config = require('./config'),
      express = require('express'),
      morgan = require('morgan'),
      bodyParser = require('body-parser'),
      
      session = require('express-session'),
      flash = require('connect-flash');
      
  module.exports = function() {
      //for this instance of express
      var app = express(); 
  
  
      //what to use in dev
      if (process.env.NODE_ENV === 'development') {
          app.use(morgan('dev'));
      } 
  
      //what to do in prod
      else if (process.env.NODE_ENV === 'production') {
          app.set('trust proxy', 1); //because secure is set to true for sessionObject in prod 
      };
       
      app.set('views', './app/views');
      app.set('view engine', 'ejs');
  
      //stuff 'n' thangs
      app.use(bodyParser.urlencoded({extended: true}));
      app.use(bodyParser.json());
      
      require('../app/routes/app.server.routes.js')(app);
      
      app.use(express.static('./public'));
      
      return app; 
  };
  