From: Carl Worth Date: Sun, 26 Apr 2020 22:29:07 +0000 (-0700) Subject: Be a bit more berbose in variable names. X-Git-Url: https://git.cworth.org/git?a=commitdiff_plain;h=ad71b2b75d960da7cb0e9a3266b1c141c13ff78e;p=lmno-server Be a bit more berbose in variable names. Preferring actual words "request" and "response" instead of abbreviations "req" and "res". --- diff --git a/server.js b/server.js index c62a9ea..b657798 100644 --- a/server.js +++ b/server.js @@ -8,19 +8,19 @@ const players = []; app.use(body_parser.urlencoded({ extended: false })); app.use(body_parser.json()); -app.get('/', function (req, res) { - res.send('Hello World!'); +app.get('/', function (requses, response) { + response.send('Hello World!'); }); -app.get('/players', function (req, res) { - res.send(players); +app.get('/players', function (request, response) { + response.send(players); }); -app.post('/register', function (req, res) { - players.push({name: req.body.name, - character: req.body.character}); - res.send(); +app.post('/register', function (request, response) { + players.push({name: request.body.name, + character: request.body.character}); + response.send(); }); app.listen(3000, function () {