diff --git a/stage1/index.js b/stage1/index.js index 54610f5..b09afbe 100644 --- a/stage1/index.js +++ b/stage1/index.js @@ -7,5 +7,5 @@ function handleRequest(request, response){ var server = http.createServer(handleRequest); server.listen(PORT, function(){ - console.log('Server listening on port: ' + PORT); + console.log(`Server listening on ${PORT}`); }); diff --git a/stage2/index.js b/stage2/index.js index d6e5128..82aa2fb 100644 --- a/stage2/index.js +++ b/stage2/index.js @@ -1,6 +1,6 @@ var express = require('express'); var logger = require('morgan'); - +var port = 3000; var app = express(); app.use(logger('dev')); // passing constructor directly into function @@ -11,6 +11,6 @@ app.get('/page2', function(request, response){ response.sendFile(__dirname + '/page2.html'); }); -app.listen('3000', function(){ // port 3000 - console.log('Server listening on port 3000'); +app.listen(port, function(){ // port 3000 + console.log(`Server listening on port ${port}`); }); diff --git a/stage3/index.js b/stage3/index.js index 243a6e1..f6d70a4 100644 --- a/stage3/index.js +++ b/stage3/index.js @@ -1,9 +1,7 @@ var express = require('express'); var logger = require('morgan'); -var ap - -p = express(); +var app = express(); app.use(logger('dev')); // passing constructor directly into function app.set('view engine', 'pug'); @@ -39,7 +37,7 @@ app.get('/users', function(request, response){ }) }); - -app.listen('3000', function(){ // port 3000 - console.log('Server listening on port 3000'); +const port = 3000; +app.listen(port, function(){ // port 3000 + console.log(`Server listening on port ${port}`); }); diff --git a/stage4/client/index.js b/stage4/client/index.js index ba642a3..689d6c3 100644 --- a/stage4/client/index.js +++ b/stage4/client/index.js @@ -85,7 +85,7 @@ app.get('/messages', function(req, res){ }); }); }); - -app.listen('3000', function(){ // port 3000 - console.log('Server listening on port 3000'); +const port = 3000; +app.listen(port, function(){ // port 3000 + console.log(`Server listening on port ${port}`); });