mirror of
https://github.com/demostf/demoserver.git
synced 2026-06-03 13:54:12 +02:00
express 4!
This commit is contained in:
parent
6c4983c792
commit
9717c83d10
1 changed files with 4 additions and 5 deletions
7
index.js
7
index.js
|
|
@ -1,12 +1,11 @@
|
|||
var express = require('express');
|
||||
var app = express();
|
||||
app.use(express.logger());
|
||||
|
||||
app.set('port', (process.env.PORT || 5000))
|
||||
app.get('/', function(request, response) {
|
||||
response.send('Hello World!');
|
||||
});
|
||||
|
||||
var port = process.env.PORT || 5000;
|
||||
app.listen(port, function() {
|
||||
console.log("Listening on " + port);
|
||||
app.listen(app.get('port'), function() {
|
||||
console.log("Node app is running at localhost:" + app.get('port'));
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue