text: // server.js
  var express = require('express');
  var mongoose = require('mongoose');
  var passport = require('passport');
  var flash = require('connect-flash');
  
  var app = express();
  var port = process.env.PORT || 8080;
  
  var configDB = require('./config/database.js');
  const appInsights = require("applicationinsights");
  
  appInsights.setup("<instrumentation_key>");
  appInsights
      .setAutoDependencyCorrelation(true)
      .setAutoCollectRequests(true)
      .setAutoCollectPerformance(true)
      .setAutoCollectExceptions(true)
      .setAutoCollectDependencies(true)
      .start();
  
  // configuration ===============================================================
  mongoose.connect(configDB.url); // connect to our database
  
  require('./config/passport')(passport); // pass passport for configuration
  
  app.configure(function () {
  
  	// set up our express application
  	app.use(express.logger('dev')); // log every request to the console
  	app.use(express.cookieParser()); // read cookies (needed for auth)
  	app.use(express.bodyParser()); // get information from html forms
  
  	app.set('view engine', 'ejs'); // set up ejs for templating
  
  	app.use(express.static('public'));//Static Content
  
  	// required for passport
  	app.use(express.session({ secret: 'ilovescotchscotchyscotchscotch' })); // session secret
  	app.use(passport.initialize());
  	app.use(passport.session()); // persistent login sessions
  	app.use(flash()); // use connect-flash for flash messages stored in session
  });
  
  // routes ======================================================================
  require('./app/routes.js')(app, passport); // load our routes and pass in our app and fully configured passport
  
  // launch ======================================================================
  app.listen(port);