Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Mar 2, 2011
1 parent c4432ee commit 6cae1f0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion examples/ejs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require.paths.unshift(__dirname + '/../../support');
* Module dependencies.
*/

var express = require('./../../lib/express');
var express = require('../../lib/express');

var app = express.createServer();

Expand Down
12 changes: 6 additions & 6 deletions examples/error-pages/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require.paths.unshift(__dirname + '/../../support');
* Module dependencies.
*/

var express = require('./../../lib/express');
var express = require('../../lib/express');

var app = express.createServer();

Expand Down Expand Up @@ -64,11 +64,11 @@ NotFound.prototype.__proto__ = Error.prototype;
// in the development environment.

app.error(function(err, req, res, next){
if (err instanceof NotFound) {
res.render('404.jade', { status: 404, error: err });
} else {
next(err);
}
if (err instanceof NotFound) {
res.render('404.jade', { status: 404, error: err });
} else {
next(err);
}
});

// Here we assume all errors as 500 for the simplicity of
Expand Down
7 changes: 5 additions & 2 deletions examples/error/app.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@

// Expose modules in ./support for demo purposes
require.paths.unshift(__dirname + '/../../support');

/**
* Module dependencies.
*/

var express = require('./../../lib/express');
var express = require('../../lib/express');

var app = express.createServer();

Expand All @@ -20,6 +23,6 @@ app.get('/next', function(req, res, next){
// The errorHandler middleware in this case will dump exceptions to stderr
// as well as show the stack trace in responses, currently handles text/plain,
// text/html, and application/json responses to aid in development
app.use('/', express.errorHandler({ dumpExceptions: true, showStack: true }));
app.use('/', express.errorHandler({ dump: true, stack: true }));

app.listen(3000);
5 changes: 5 additions & 0 deletions examples/flash/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ app.set('view engine', 'ejs');
// value of this function.

app.dynamicHelpers({
// as an alternative to this install the
// express-messages helper via npm
//
// $ npm install express-messages
//
messages: function(req, res){
// In the case of flash messages
// we return a function, allowing
Expand Down

0 comments on commit 6cae1f0

Please sign in to comment.