From 814595eedadb52bf1f72bc19091ef810b7283e6c Mon Sep 17 00:00:00 2001 From: Daniel Mahon Date: Wed, 4 Dec 2013 14:14:37 -0500 Subject: [PATCH] adds express-validator for easy form validation --- appy.js | 2 ++ package.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/appy.js b/appy.js index 059111b..5310cab 100644 --- a/appy.js +++ b/appy.js @@ -11,6 +11,7 @@ var dirname = require('path').dirname; var lessMiddleware = require('less-middleware'); var passwordHash = require('password-hash'); var clone = require('clone'); +var expressValidator = require('express-validator'); var options; var db; @@ -420,6 +421,7 @@ function appBootstrap(callback) { } app.use(express.bodyParser()); + app.use(expressValidator(options.expressValidator)); app.use(express.cookieParser()); // Express sessions let us remember the mood the user wanted while they are off logging in on twitter.com diff --git a/package.json b/package.json index 5afe3c4..798b06c 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "mongodb": "~1.3.19", "async": "~0.2.9", "connect-mongo": "~0.3.3", - "clone": "~0.1.11" + "clone": "~0.1.11", + "express-validator": "~1.0.1" }, "devDependencies": {}, "optionalDependencies": {},