Skip to content

Commit

Permalink
Merge tag '3.9.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed May 31, 2014
2 parents 311e83e + 0dc5836 commit db4448d
Show file tree
Hide file tree
Showing 50 changed files with 600 additions and 198 deletions.
35 changes: 35 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
unreleased
==========

* custom etag control with `app.set('etag', val)`
- `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation
- `app.set('etag', 'weak')` weak tag
- `app.set('etag', 'strong')` strong etag
- `app.set('etag', false)` turn off
- `app.set('etag', true)` standard etag
* mark `res.send` ETag as weak and reduce collisions
* update send to 0.4.0
- Calculate ETag with md5 for reduced collisions
- Ignore stream errors after request ends
- deps: debug@0.8.1

4.3.2 / 2014-05-28
==================

Expand Down Expand Up @@ -124,6 +139,26 @@
- `app.route()` - Proxy to the app's `Router#route()` method to create a new route
- Router & Route - public API

3.9.0 / 2014-05-30
==================

* custom etag control with `app.set('etag', val)`
- `app.set('etag', function(body, encoding){ return '"etag"' })` custom etag generation
- `app.set('etag', 'weak')` weak tag
- `app.set('etag', 'strong')` strong etag
- `app.set('etag', false)` turn off
- `app.set('etag', true)` standard etag
* Include ETag in HEAD requests
* mark `res.send` ETag as weak and reduce collisions
* update connect to 2.18.0
- deps: compression@1.0.3
- deps: serve-index@1.1.0
- deps: serve-static@1.2.0
* update send to 0.4.0
- Calculate ETag with md5 for reduced collisions
- Ignore stream errors after request ends
- deps: debug@0.8.1

3.8.1 / 2014-05-27
==================

Expand Down
1 change: 1 addition & 0 deletions examples/auth/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ app.post('/login', function(req, res){
});
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
Expand Down
7 changes: 5 additions & 2 deletions examples/big-view/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,8 @@ app.get('/', function(req, res){
res.render('pets', { pets: pets });
});

app.listen(3000);
console.log('Express listening on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
3 changes: 2 additions & 1 deletion examples/content-negotiation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ function format(path) {

app.get('/users', format('./users'));

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('listening on port 3000');
console.log('Express started on port 3000');
}
3 changes: 2 additions & 1 deletion examples/cookie-sessions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function count(req, res) {
res.send('viewed ' + n + ' times\n');
}

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express server listening on port 3000');
console.log('Express started on port 3000');
}
6 changes: 3 additions & 3 deletions examples/cookies/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');

// custom log format
if ('test' != process.env.NODE_ENV)
app.use(logger(':method :url'));
if ('test' != process.env.NODE_ENV) app.use(logger(':method :url'));

// parses request cookies, populating
// req.cookies and req.signedCookies
Expand Down Expand Up @@ -42,7 +41,8 @@ app.post('/', function(req, res){
res.redirect('back');
});

if (!module.parent){
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
1 change: 1 addition & 0 deletions examples/downloads/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ app.use(function(err, req, res, next){
}
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
Expand Down
3 changes: 2 additions & 1 deletion examples/ejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ app.get('/', function(req, res){
});
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express app started on port 3000');
console.log('Express started on port 3000');
}
7 changes: 3 additions & 4 deletions examples/error-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ app.enable('verbose errors');

// disable them in production
// use $ NODE_ENV=production node examples/error-pages
if ('production' == app.settings.env) {
app.disable('verbose errors');
}
if ('production' == app.settings.env) app.disable('verbose errors');

silent || app.use(logger('dev'));

Expand Down Expand Up @@ -99,7 +97,8 @@ app.use(function(err, req, res, next){
});


/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
silent || console.log('Express started on port 3000');
console.log('Express started on port 3000');
}
1 change: 1 addition & 0 deletions examples/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ app.get('/next', function(req, res, next){
// from app.get() etc
app.use(error);

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
Expand Down
7 changes: 5 additions & 2 deletions examples/expose-data-to-client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ app.get('/user', function(req, res){
res.render('page');
});

app.listen(3000);
console.log('app listening on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/hello-world/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,8 @@ app.get('/', function(req, res){
res.send('Hello World');
});

app.listen(3000);
console.log('Express started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/jade/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ app.use(function(err, req, res, next) {
res.send(err.stack);
});

app.listen(3000);
console.log('Express app started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
1 change: 1 addition & 0 deletions examples/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ app.get('/fail', function(req, res){
res.render('missing', { title: 'Markdown Example' });
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
Expand Down
1 change: 1 addition & 0 deletions examples/multipart/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ app.post('/', function(req, res, next){
form.parse(req);
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(4000);
console.log('Express started on port 3000');
Expand Down
3 changes: 2 additions & 1 deletion examples/mvc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ app.use(function(req, res, next){
res.status(404).render('404', { url: req.originalUrl });
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('\n listening on port 3000\n');
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/online/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,8 @@ app.get('/', function(req, res, next){
});
});

app.listen(3000);
console.log('listening on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 4 additions & 3 deletions examples/params/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ var users = [
// Convert :to and :from to integers

app.param(['to', 'from'], function(req, res, next, num, name){
req.params[name] = num = parseInt(num, 10);
if( isNaN(num) ){
req.params[name] = parseInt(num, 10);
if( isNaN(req.params[name]) ){
next(new Error('failed to parseInt '+num));
} else {
next();
Expand Down Expand Up @@ -63,7 +63,8 @@ app.get('/users/:from-:to', function(req, res, next){
res.send('users ' + names.slice(from, to).join(', '));
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
}
11 changes: 7 additions & 4 deletions examples/resource/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ app.resource = function(path, obj) {
obj.range(req, res, a, b, format);
});
this.get(path + '/:id', obj.show);
this.delete(path + '/:id', obj.destroy);
this.delete(path + '/:id', function(req, res){
var id = parseInt(req.params.id, 10);
obj.destroy(req, res, id);
});
};

// Fake records
Expand All @@ -40,8 +43,7 @@ var User = {
show: function(req, res){
res.send(users[req.params.id] || { error: 'Cannot find user' });
},
destroy: function(req, res){
var id = req.params.id;
destroy: function(req, res, id){
var destroyed = id in users;
delete users[id];
res.send(destroyed ? 'destroyed' : 'Cannot find user');
Expand Down Expand Up @@ -84,7 +86,8 @@ app.get('/', function(req, res){
].join('\n'));
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
}
6 changes: 5 additions & 1 deletion examples/route-map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,8 @@ app.map({
}
});

app.listen(3000);
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/route-middleware/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,8 @@ app.delete('/user/:id', loadUser, andRestrictTo('admin'), function(req, res){
res.send('Deleted user ' + req.user.name);
});

app.listen(3000);
console.log('Express app started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/route-separation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ app.put('/user/:id/edit', user.update);

app.get('/posts', post.list);

app.listen(3000);
console.log('Express app started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/search/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,8 @@ app.get('/client.js', function(req, res){
res.sendfile(__dirname + '/client.js');
});

app.listen(3000);
console.log('app listening on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,8 @@ app.get('/', function(req, res){
res.send(body + '<p>viewed <strong>' + req.session.views + '</strong> times.</p>');
});

app.listen(3000);
console.log('Express app started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
7 changes: 5 additions & 2 deletions examples/vhost/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ var app = express();
app.use(vhost('*.example.com', redirect)); // Serves all subdomains via Redirect app
app.use(vhost('example.com', main)); // Serves top level domain via Main server app

app.listen(3000);
console.log('Express app started on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
1 change: 1 addition & 0 deletions examples/view-constructor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ app.get('/Readme.md', function(req, res){
res.render('Readme.md');
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
Expand Down
7 changes: 5 additions & 2 deletions examples/view-locals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,5 +145,8 @@ app.all('/api/*', function(req, res, next){
*/

app.listen(3000);
console.log('Application listening on port 3000');
/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express started on port 3000');
}
3 changes: 2 additions & 1 deletion examples/web-service/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ app.use(function(req, res){
res.send(404, { error: "Lame, can't find that" });
});

/* istanbul ignore next */
if (!module.parent) {
app.listen(3000);
console.log('Express server listening on port 3000');
console.log('Express started on port 3000');
}
Loading

0 comments on commit db4448d

Please sign in to comment.