Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

less verbose example apps when testing

  • Loading branch information...
commit 30167356f20d5751ec88b08e27f8ce0c82d52679 1 parent 441b309
@tj tj authored
Showing with 3 additions and 7 deletions.
  1. +1 −1  examples/auth/app.js
  2. +2 −6 examples/mvc/index.js
View
2  examples/auth/app.js
@@ -48,7 +48,7 @@ function hash(msg, key) {
// Authenticate using our plain-object database of doom!
function authenticate(name, pass, fn) {
- console.log('authenticating %s:%s', name, pass);
+ if (!module.parent) console.log('authenticating %s:%s', name, pass);
var user = users[name];
// query the db for the given username
if (!user) return fn(new Error('cannot find user'));
View
8 examples/mvc/index.js
@@ -35,15 +35,11 @@ app.locals.use(function(req, res){
// expose "hasMessages"
res.locals.hasMessages = !! msgs.length;
- /*
-
- This is equivalent:
-
+ /* This is equivalent:
res.locals({
messages: msgs,
hasMessages: !! msgs.length
});
-
*/
// empty or "flush" the messages so they
@@ -52,7 +48,7 @@ app.locals.use(function(req, res){
});
// log
-app.use(express.logger('dev'));
+if (!module.parent) app.use(express.logger('dev'));
// serve static files
app.use(express.static(__dirname + '/public'));
Please sign in to comment.
Something went wrong with that request. Please try again.