Permalink
Browse files

docs

  • Loading branch information...
1 parent c4432ee commit 6cae1f09f1b70861824551eb0894b1d3c401552e @tj tj committed Mar 2, 2011
Showing with 17 additions and 9 deletions.
  1. +1 −1 examples/ejs/app.js
  2. +6 −6 examples/error-pages/app.js
  3. +5 −2 examples/error/app.js
  4. +5 −0 examples/flash/app.js
View
@@ -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();
@@ -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();
@@ -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
View
@@ -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();
@@ -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);
View
@@ -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

0 comments on commit 6cae1f0

Please sign in to comment.