Skip to content

Commit

Permalink
chore: lint ./app/index.js #242
Browse files Browse the repository at this point in the history
  • Loading branch information
billchurch committed May 13, 2021
1 parent 140e0a2 commit 44ce925
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions app/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
'use strict'
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
/* jshint esversion: 6, asi: true, node: true */
/*
* index.js
Expand All @@ -8,21 +8,23 @@
*
*/

const config = require('./server/app').config
const server = require('./server/app').server
const { config } = require('./server/app');
const { server } = require('./server/app');

server.listen({ host: config.listen.ip, port: config.listen.port })
server.listen({ host: config.listen.ip, port: config.listen.port });

console.log('WebSSH2 service listening on ' + config.listen.ip + ':' + config.listen.port)
// eslint-disable-next-line no-console
console.log(`WebSSH2 service listening on ${config.listen.ip}:${config.listen.port}`);

server.on('error', function (err) {
server.on('error', (err) => {
if (err.code === 'EADDRINUSE') {
config.listen.port++
console.warn('WebSSH2 Address in use, retrying on port ' + config.listen.port)
setTimeout(function () {
server.listen(config.listen.port)
}, 250)
config.listen.port += 1;
console.warn(`WebSSH2 Address in use, retrying on port ${config.listen.port}`);
setTimeout(() => {
server.listen(config.listen.port);
}, 250);
} else {
console.log('WebSSH2 server.listen ERROR: ' + err.code)
// eslint-disable-next-line no-console
console.log(`WebSSH2 server.listen ERROR: ${err.code}`);
}
})
});

0 comments on commit 44ce925

Please sign in to comment.