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 () {