text: 'use strict';
  
  let path = require('path');
  let express = require('express');
  let cookieParser = require('cookie-parser');
  let bodyParser = require('body-parser');
  
  let app = express();
  
  app.use(bodyParser.json());
  app.use(bodyParser.urlencoded({ extended: false }));
  
  app.use(express.static(path.join(__dirname, 'dist')));
  
  const forceSSL = function() {
    return function (req, res, next) {
      if (req.headers['x-forwarded-proto'] !== 'https') {
        return res.redirect(
         ['https://', req.get('Host'), req.url].join('')
        );
      }
      next();
    }
  }
  // Instruct the app
  // to use the forceSSL
  // middleware
  app.use(forceSSL());
  
  app.get('*', (req, res) => {
    res.sendFile(path.join(__dirname, 'dist/index.html'));
  });
  
  let port = process.env.PORT || 8081;
  let server = app.listen(port, () => {
  	console.log('Server is now running.', port);
  });
  
  module.exports = server;