fix: log listening port, remove error (#21)
* fix: log listening port * fix: remove empty line * chore: remove unused error * spacing, ey... Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
parent
32bb55e7c4
commit
be86d60221
@ -50,10 +50,9 @@ module.exports = function (app) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
let error;
|
|
||||||
app.get('/_api/get-tests', cors(), function(req, res, next){
|
app.get('/_api/get-tests', cors(), function(req, res, next){
|
||||||
console.log(error);
|
console.log('requested');
|
||||||
if(!error && process.env.NODE_ENV === 'test') return next();
|
if(process.env.NODE_ENV === 'test') return next();
|
||||||
res.json({status: 'unavailable'});
|
res.json({status: 'unavailable'});
|
||||||
},
|
},
|
||||||
function(req, res, next){
|
function(req, res, next){
|
||||||
|
@ -47,17 +47,16 @@ app.use(function(req, res, next) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
//Start our server and tests!
|
//Start our server and tests!
|
||||||
app.listen(process.env.PORT || 3000, function () {
|
const listener = app.listen(process.env.PORT || 3000, function () {
|
||||||
console.log("Listening on port " + process.env.PORT);
|
console.log('Your app is listening on port ' + listener.address().port);
|
||||||
if(process.env.NODE_ENV==='test') {
|
if(process.env.NODE_ENV==='test') {
|
||||||
console.log('Running Tests...');
|
console.log('Running Tests...');
|
||||||
setTimeout(function () {
|
setTimeout(function () {
|
||||||
try {
|
try {
|
||||||
runner.run();
|
runner.run();
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
let error = e;
|
|
||||||
console.log('Tests are not valid:');
|
console.log('Tests are not valid:');
|
||||||
console.log(error);
|
console.error(e);
|
||||||
}
|
}
|
||||||
}, 3500);
|
}, 3500);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user