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){
|
||||
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){
|
||||
|
@ -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.error(e);
|
||||
}
|
||||
}, 3500);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user