mirror of
https://github.com/zebrajr/express.git
synced 2026-01-15 12:15:27 +00:00
merged
This commit is contained in:
@@ -79,11 +79,7 @@ res.send = function(body){
|
||||
switch (typeof body) {
|
||||
// response status
|
||||
case 'number':
|
||||
<<<<<<< HEAD
|
||||
this.get('Content-Type') || this.type('txt');
|
||||
=======
|
||||
this.get('Content-Type') || this.type('.txt');
|
||||
>>>>>>> feature/send-etag
|
||||
this.statusCode = body;
|
||||
body = http.STATUS_CODES[body];
|
||||
break;
|
||||
@@ -99,11 +95,7 @@ res.send = function(body){
|
||||
if (null == body) {
|
||||
body = '';
|
||||
} else if (Buffer.isBuffer(body)) {
|
||||
<<<<<<< HEAD
|
||||
this.get('Content-Type') || this.type('bin');
|
||||
=======
|
||||
this.get('Content-Type') || this.type('.bin');
|
||||
>>>>>>> feature/send-etag
|
||||
} else {
|
||||
return this.json(body);
|
||||
}
|
||||
|
||||
@@ -9,11 +9,8 @@ var app = express()
|
||||
, blog = express()
|
||||
, admin = express();
|
||||
|
||||
<<<<<<< HEAD
|
||||
blog.use('/admin', admin);
|
||||
=======
|
||||
// app.use(express.logger('dev'))
|
||||
>>>>>>> feature/send-etag
|
||||
blog.use('/admin', admin);
|
||||
app.use('/blog', blog);
|
||||
app.set('views', __dirname + '/views');
|
||||
app.set('view engine', 'jade');
|
||||
@@ -25,20 +22,8 @@ app.get('/render', function(req, res){
|
||||
res.render('hello');
|
||||
});
|
||||
|
||||
<<<<<<< HEAD
|
||||
admin.get('/', function(req, res){
|
||||
res.send('Hello World\n');
|
||||
=======
|
||||
app.get('/json/small', function(req, res){
|
||||
res.send(repo);
|
||||
});
|
||||
|
||||
app.get('/json/large', function(req, res){
|
||||
var repos = [];
|
||||
var n = 10;
|
||||
while (n--) repos.push(repo);
|
||||
res.send(repos);
|
||||
>>>>>>> feature/send-etag
|
||||
});
|
||||
|
||||
blog.get('/', function(req, res){
|
||||
|
||||
@@ -20,24 +20,13 @@ bench_conditional() {
|
||||
sleep .5
|
||||
bench / "Hello World"
|
||||
bench /blog "Mounted Hello World"
|
||||
<<<<<<< HEAD
|
||||
bench /blog/admin "Mounted 2 Hello World"
|
||||
=======
|
||||
>>>>>>> feature/send-etag
|
||||
bench /middleware "Middleware"
|
||||
bench /match "Router"
|
||||
bench /render "Render"
|
||||
bench /json "JSON tiny"
|
||||
<<<<<<< HEAD
|
||||
bench /json/15 "JSON small"
|
||||
bench /json/50 "JSON medium"
|
||||
bench /json/150 "JSON large"
|
||||
=======
|
||||
bench /json/small "JSON small"
|
||||
bench /json/large "JSON large"
|
||||
bench_conditional /json/large "JSON large etag" -1355435680
|
||||
|
||||
# 1.25 mb/s
|
||||
>>>>>>> feature/send-etag
|
||||
|
||||
kill -9 $pid
|
||||
Reference in New Issue
Block a user