diff --git a/index.js b/index.js index 19894c7..f12ccba 100644 --- a/index.js +++ b/index.js @@ -73,6 +73,11 @@ app.post('/disconnect', (req, res) => { res.status(200).send(); }); +// User wants to measure ping +app.get('/ping', (req, res) => { + res.status(200).send(); +}); + // User wants to change name app.post('/nickname', (req, res) => { const { oldName, name, id } = req.body; @@ -87,7 +92,7 @@ app.post('/nickname', (req, res) => { for (const u of users) if (u.name === oldName && u.id === id) { if (consoleLogging) - console.log(`Renamed user with ID '${oldName}#${id}'.`); + console.log(`(Re-)named user with ID '${oldName}#${id}'.`); u.name = name; u.id = currentID; break; @@ -140,7 +145,7 @@ app.post('/message', (req, res) => { // Log message for debugging if (consoleLogging) - console.log(`User '${name}#${id}' sent message '${message}' to '${recipient}'.`); + console.log(`User '${name}#${id}' sent message '${message}'.`); // Confirm process res.status(200).send();