var express = require('express');
var app = express();
var env = process.env.NODE_ENV || 'development';

var forceSSL = function (req, res, next) {
  if (req.headers['x-forwarded-proto'] !== 'https') {
      return res.redirect(['https://', req.get('Host'), req.url].join(''));
  }
  return next();
};

if (env === 'production') {
    app.use(forceSSL);
}

app.set('view engine', 'ejs');

var proxy = require('http-proxy-middleware');
app.use(
  proxy('/api', {
    target: 'https://v1.peachapi.com',
    changeOrigin: true,
    pathRewrite: {
      '^/api': ''
    },
  })
);
app.use('/static', express.static('public'));

var request = require('request');

var requestWithStreamToken = function (method, action, options, callback) {
  options = options || {};
  options['method'] = method;
  options['uri'] = 'http://localhost:3000/api/' + action;
  options['auth'] = {'bearer': TEST_TOKEN};
  request(options, callback);
};

app.get('/', function (req, res) {
  res.render('home');
});

app.get('/stream', function (req, res) {
  requestWithStreamToken('GET', 'connections', null, function (error, response, body) {
    console.log(body);
  });
});

var port = process.env.PORT || 3000;
app.listen(port, function () {
  console.log('App started on port ' + port);
});

@@ -656,277 +656,8 @@
 );%0A%0A
-var requestWithStreamToken = function (method, action, options, callback) %7B%0A  options = options %7C%7C %7B%7D;%0A  options%5B'method'%5D = method;%0A  options%5B'uri'%5D = 'http://localhost:3000/api/' + action;%0A  options%5B'auth'%5D = %7B'bearer': TEST_TOKEN%7D;%0A  request(options, callback);%0A%7D;%0A%0A
 app.

Remove unused test function