Update main.js

This commit is contained in:
钟进 2018-09-25 12:16:05 +08:00
parent 8ca9272606
commit 2a0607b3c1

10
main.js
View File

@ -195,6 +195,16 @@ function initWebServer(settings) {
adapter.log.info('config port: ' + settings.port); adapter.log.info('config port: ' + settings.port);
adapter.getPort(settings.port, function (port) {
if (port != settings.port && !adapter.config.findNextPort) {
adapter.log.error('port ' + settings.port + ' already in use');
process.exit(1);
}
webServer.listen(port, settings.bind, function() {
adapter.log.info('Server listening on http' + (settings.secure ? 's' : '') + '://' + settings.bind + ':' + port);
});
});
/* /*
if (settings.port) { if (settings.port) {
if (settings.secure) { if (settings.secure) {