This commit is contained in:
Dobromir Popov 2024-03-20 08:54:17 +00:00
commit c0f48327b5
2 changed files with 2 additions and 3 deletions

View File

@ -1 +0,0 @@
7

View File

@ -3,7 +3,7 @@ if (require('dotenv')) {
require('dotenv').config() require('dotenv').config()
} }
console.log('Starting ws server on port '+ process.env.SERVER_PORT_WS); console.log('Starting ws server on port ' + process.env.SERVER_PORT_WS);
const WebSocket = require('ws'); const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: process.env.SERVER_PORT_WS }); const wss = new WebSocket.Server({ port: process.env.SERVER_PORT_WS });
@ -120,7 +120,7 @@ app.get('/', (req, res) => {
//accept LOG messages on /log //accept LOG messages on /log
app.post('/log', (req, res) => { app.post('/log', (req, res) => {
console.log("log["+new Date().toISOString() + '] ' + req.body.message); console.log("log[" + new Date().toISOString() + '] ' + req.body.message);
res.send('OK', 200, { 'Content-Type': 'text/plain' }); res.send('OK', 200, { 'Content-Type': 'text/plain' });
}); });