From 44ce925a96af777537400ef36cc956f9b7b4a623 Mon Sep 17 00:00:00 2001 From: Bill Church Date: Thu, 13 May 2021 09:26:46 -0400 Subject: [PATCH] chore: lint ./app/index.js #242 --- app/index.js | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/index.js b/app/index.js index 698108f1..305459e2 100644 --- a/app/index.js +++ b/app/index.js @@ -1,4 +1,4 @@ -'use strict' +/* eslint no-console: ["error", { allow: ["warn", "error"] }] */ /* jshint esversion: 6, asi: true, node: true */ /* * index.js @@ -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}`); } -}) +});