Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 9717c83

Browse files
committed
express 4!
1 parent 6c4983c commit 9717c83

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
var express = require('express');
22
var app = express();
3-
app.use(express.logger());
43

4+
app.set('port', (process.env.PORT || 5000))
55
app.get('/', function(request, response) {
66
response.send('Hello World!');
77
});
88

9-
var port = process.env.PORT || 5000;
10-
app.listen(port, function() {
11-
console.log("Listening on " + port);
12-
});
9+
app.listen(app.get('port'), function() {
10+
console.log("Node app is running at localhost:" + app.get('port'));
11+
});

0 commit comments

Comments
 (0)