diff --git a/routes/fcctesting.js b/routes/fcctesting.js index a892003..33e631b 100644 --- a/routes/fcctesting.js +++ b/routes/fcctesting.js @@ -49,11 +49,10 @@ module.exports = function (app) { res.type('txt').send(data.toString()); }); }); - - let error; + app.get('/_api/get-tests', cors(), function(req, res, next){ - console.log(error); - if(!error && process.env.NODE_ENV === 'test') return next(); + console.log('requested'); + if(process.env.NODE_ENV === 'test') return next(); res.json({status: 'unavailable'}); }, function(req, res, next){ diff --git a/server.js b/server.js index 665c308..7d63e9f 100644 --- a/server.js +++ b/server.js @@ -47,17 +47,16 @@ app.use(function(req, res, next) { }); //Start our server and tests! -app.listen(process.env.PORT || 3000, function () { - console.log("Listening on port " + process.env.PORT); +const listener = app.listen(process.env.PORT || 3000, function () { + console.log('Your app is listening on port ' + listener.address().port); if(process.env.NODE_ENV==='test') { console.log('Running Tests...'); setTimeout(function () { try { runner.run(); } catch(e) { - let error = e; - console.log('Tests are not valid:'); - console.log(error); + console.log('Tests are not valid:'); + console.error(e); } }, 3500); }