var express = require('express');
var app = express();

app.set('port', (process.env.PORT || 5000));

app.use(express.static(__dirname + '/public'));

// views is directory for all template files
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');

app.get('/', function(request, response) {
  response.render('pages/index');
});

app.get('/webhook/pullrequest/', function(request, response) {
  // TODO: Read CODEREVIEW.md at the root of repo
  // TODO: HTTP-POST a new checklist onto the PR
  // TODO: Use async task to create a new checklist
  response.render('pages/index');
});

// TODO: Read Github access token from environment
// TODO: Configure repo location
// TODO: Setup webhook on Github

app.listen(app.get('port'), function() {
  console.log('Node app is running on port', app.get('port'));
});



@@ -27,16 +27,45 @@
 ress');%0A
+var util = require('util');%0A%0A
 var app 
@@ -77,16 +77,16 @@
 ress();%0A
-
 %0Aapp.set
@@ -120,24 +120,777 @@
 %7C%7C 5000));%0A%0A
+// Github username and access token used for Basic Auth.%0Avar username = process.env.GITHUB_USERNAME %7C%7C null;%0Avar token = process.env.ACCESS_TOKEN %7C%7C null;%0Avar repo = process.env.GITHUB_REPO %7C%7C null;%0A%0Aif (!username) %7B%0A  var msg = 'Please specify Github %25s via environment variable: %25s';%0A  msg = util.format(msg, 'username', 'GITHUB_USERNAME');%0A  console.warn(msg);%0A%0A  process.exit(1);%0A%7D%0A%0Aif (!token) %7B%0A  var msg = 'Please specify Github %25s via environment variable: %25s';%0A  msg = util.format(msg, 'access token', 'ACCESS_TOKEN');%0A  console.warn(msg);%0A%0A  process.exit(1);%0A%7D%0A%0Aif (!repo) %7B%0A  var msg = 'Please specify Github %25s via environment variable: %25s';%0A  msg = util.format(msg, 'repository', 'GITHUB_REPO');%0A  console.warn(msg);%0A%0A  process.exit(1);%0A%7D%0A%0A
 app.use(expr
@@ -1382,92 +1382,8 @@
 );%0A%0A
-// TODO: Read Github access token from environment%0A// TODO: Configure repo location%0A
 // T

Read settings from environment