summaryrefslogtreecommitdiffstats
path: root/simpleserver.js
blob: b90d6ea6ef8aed273a5de870f6e925eab3635aab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
var express = require('express');

var app = express.createServer();

app.configure(function() {
    app.use(express.logger('dev'));
    app.use(express.favicon());
    app.use(app.router);
});

app.get('/*', function(req, res) {
    res.send('hello, world!\n');
});

app.listen(8080, function() {
    console.log("listening on port %d in %s mode", this.address().port, this.settings.env);
})
.on('error', function(e) {
    console.log('failed creating server, errno: ' + e.errno);
});