LearningWebAppDev icon indicating copy to clipboard operation
LearningWebAppDev copied to clipboard

Express 4 Migration

Open semmypurewal opened this issue 10 years ago • 1 comments

Alex Koutmos was kind enough to send this information regarding the migration from Express 3 to Express 4. It is included below.

I found some good information here regarding Express 3->4 migration: http://scotch.io/bar-talk/expressjs-4-0-new-features-and-upgrading-from-3-0

And to specifically fix the issue in the server.js file, I did the following:

  1. 'npm install body-parser' in the project directory
  2. I then added 'bodyParser = require("body-parser")' in my server.js
  3. Lastly, instead of 'app.use(express.urlencoded())' I did 'app.use(bodyParser.urlencoded({"extended" : "true"}))'

semmypurewal avatar Oct 20 '14 13:10 semmypurewal

Added this to our official errata page: http://learningwebappdev.com/errata/chapter6/2015/01/04/chapter-6-express-4-migration.html

Will update examples here soon, and will make sure the latest code in the book uses Express 4 in the next ebook update. Then I'll close this out.

semmypurewal avatar Jan 05 '15 02:01 semmypurewal