File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
serving/samples/helloworld-nodejs Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,13 @@ recreate the source files from this folder.
5252 app.get(' /' , function (req, res) {
5353 console.log(' Hello world received a request.' );
5454
55- var target = process.env.TARGET || ' World' ;
56- res.send(' Hello ' + target);
55+ const target = process.env.TARGET || ' World' ;
56+ res.send(' Hello ' + target + ' ! ' );
5757 });
5858
59- var port = 8080;
59+ const port = process.env.PORT || 8080;
6060 app.listen(port, function () {
61- console.log(' Hello world listening on port' , port);
61+ console.log(' Hello world listening on port' , port);
6262 });
6363 ` ` `
6464
Original file line number Diff line number Diff line change @@ -20,11 +20,11 @@ const app = express();
2020app . get ( '/' , function ( req , res ) {
2121 console . log ( 'Hello world received a request.' ) ;
2222
23- var target = process . env . TARGET || 'World' ;
24- res . send ( 'Hello ' + target ) ;
23+ const target = process . env . TARGET || 'World' ;
24+ res . send ( 'Hello ' + target + '!' ) ;
2525} ) ;
2626
27- var port = 8080 ;
27+ const port = process . env . PORT || 8080 ;
2828app . listen ( port , function ( ) {
29- console . log ( 'Hello world listening on port' , port ) ;
29+ console . log ( 'Hello world listening on port' , port ) ;
3030} ) ;
You can’t perform that action at this time.
0 commit comments