From 0061b146e85146e213e87d1b4bef62779e05202e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Cervi=C3=B1o?= Date: Fri, 20 Sep 2019 09:38:33 +0200 Subject: [PATCH] Fix basic example port (#1460) --- extras/basic_example/basicServer.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/extras/basic_example/basicServer.js b/extras/basic_example/basicServer.js index b0e57deaf3..a43e20a08d 100644 --- a/extras/basic_example/basicServer.js +++ b/extras/basic_example/basicServer.js @@ -200,9 +200,18 @@ app.use((req, res, next) => { cleanExampleRooms(() => { getOrCreateRoom(defaultRoomName, undefined, undefined, (roomId) => { defaultRoom = roomId; - app.listen(config.basicExample.port || 3001); + let port = 3001; + let tlsPort = 3004; + if (config.basicExample && config.basicExample.port) { + port = config.basicExample.port; + } + if (config.basicExample && config.basicExample.tlsPort) { + tlsPort = config.basicExample.tlsPort; + } + + app.listen(port); const server = https.createServer(options, app); console.log('BasicExample started'); - server.listen(config.basicExample.tlsPort || 3004); + server.listen(tlsPort); }); });