]> git.cworth.org Git - lmno-server/commitdiff
Be a bit more berbose in variable names.
authorCarl Worth <cworth@cworth.org>
Sun, 26 Apr 2020 22:29:07 +0000 (15:29 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 26 Apr 2020 22:29:07 +0000 (15:29 -0700)
Preferring actual words "request" and "response" instead of
abbreviations "req" and "res".

server.js

index c62a9ea85d9bd8568e80e59f64b1be01eafabcfa..b657798ae2fcf81284f7c4b009322d291347b9c6 100644 (file)
--- 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 () {