From 4eb1525fb6c5dd22947236515a07801c0d225aef Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Sat, 7 Feb 2026 22:11:42 +0100 Subject: [PATCH] [call-me] - fix typo --- app/server.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/app/server.js b/app/server.js index 9202d2d..a555673 100755 --- a/app/server.js +++ b/app/server.js @@ -167,18 +167,7 @@ async function ngrokStart() { } } -// Start the server and listen on the specified port -server.listen(port, () => { - if (ngrokEnabled && ngrokAuthToken) { - ngrokStart(); - } else { - log.info('Server', getServerConfig()); - } -}); - -// Handle WebSocket connections -io.on('connection', handleConnection); - +// Configure Express middleware BEFORE starting the server app.use(cors(corsOptions)); // Handle cors options app.use(helmet.noSniff()); // Enable content type sniffing prevention app.use(express.static(PUBLIC_DIR)); // Serve static files from the 'public' directory @@ -361,6 +350,18 @@ const isAuthorized = (req) => { return authorization === config.apiKeySecret; }; +// Start the server and listen on the specified port +server.listen(port, () => { + if (ngrokEnabled && ngrokAuthToken) { + ngrokStart(); + } else { + log.info('Server', getServerConfig()); + } +}); + +// Handle WebSocket connections +io.on('connection', handleConnection); + // Function to handle individual WebSocket connections function handleConnection(socket) { log.debug('User connected:', socket.id);