From 1367f8ad37cf0e8732254b241be6061146a88d6a Mon Sep 17 00:00:00 2001 From: ecapswen Date: Fri, 11 Mar 2016 00:47:05 -0800 Subject: [PATCH 1/3] Fixed deprecated modules --- app.js | 9 +++++---- package.json | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app.js b/app.js index f09e09d96..ade7469a0 100644 --- a/app.js +++ b/app.js @@ -6,7 +6,7 @@ var express = require('express'), bodyParser = require('body-parser'), methodOverride = require('method-override'), - errorHandler = require('error-handler'), + errorHandler = require('express-error-handler'), morgan = require('morgan'), routes = require('./routes'), api = require('./routes/api'), @@ -21,11 +21,12 @@ var app = module.exports = express(); */ // all environments -app.set('port', process.env.PORT || 3000); +app.set('port', process.env.PORT || 8081); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(morgan('dev')); -app.use(bodyParser()); +app.use(bodyParser.urlencoded({extended: true})); +app.use(bodyParser.json()); app.use(methodOverride()); app.use(express.static(path.join(__dirname, 'public'))); @@ -33,7 +34,7 @@ var env = process.env.NODE_ENV || 'development'; // development only if (env === 'development') { - app.use(express.errorHandler()); + app.use(errorHandler()); } // production only diff --git a/package.json b/package.json index 4b627f3e8..ff0261f7d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "body-parser": "^1.0.2", - "error-handler": "^0.1.4", + "errorhandler": "^1.4.3", "express": "~4.1.1", "jade": "~0.31.2", "method-override": "^1.0.0", From 95129477fcc1a8697bdc9fa191bc571b43c2d780 Mon Sep 17 00:00:00 2001 From: ecapswen Date: Fri, 11 Mar 2016 00:53:00 -0800 Subject: [PATCH 2/3] fix express-error-handler not found --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ff0261f7d..67c89ab9a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "body-parser": "^1.0.2", - "errorhandler": "^1.4.3", + "express-error-handler": "^1.0.1", "express": "~4.1.1", "jade": "~0.31.2", "method-override": "^1.0.0", From e17f778d24692fff45f737d10acf3bf6847f631f Mon Sep 17 00:00:00 2001 From: ecapswen Date: Fri, 11 Mar 2016 01:06:40 -0800 Subject: [PATCH 3/3] change back to port 3000 --- app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.js b/app.js index ade7469a0..7eaecc224 100644 --- a/app.js +++ b/app.js @@ -21,7 +21,7 @@ var app = module.exports = express(); */ // all environments -app.set('port', process.env.PORT || 8081); +app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(morgan('dev'));