Created
June 10, 2011 16:08
-
-
Save tj/1019167 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = express.createServer(); | |
app.get('/hello', function(req, res){ | |
res.send('Hi there!'); | |
}); | |
app.listen(3000); | |
// ab -n 8000 -c 40 http://local:3000/hello (no keep-alive) | |
// 4068.51 rps |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var journey = require('../'); | |
var router = new(journey.Router); | |
router.get('/hello').bind(function (req, res) { res.send('Hi there!') }); | |
require('http').createServer(function (request, response) { | |
router.handle(request, '{}', function(res){ | |
response.writeHead(200, res.headers); | |
response.end(res.body); | |
}); | |
}).listen(3000); | |
// ab -n 8000 -c 40 http://local:3000/hello (no keep-alive) | |
// 3340.99 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment