Last active
October 18, 2016 06:11
-
-
Save ProfAvery/6f7c9f5b1e06977aacbce4ccaf7bf2b4 to your computer and use it in GitHub Desktop.
Updates to Chapter6/app/Amazeriffic/server.js for Express 4.x
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Chapter6/app/Amazeriffic/server.js b/Chapter6/app/Amazeriffic/server.js | |
index fc11916..dceaa69 100644 | |
--- a/Chapter6/app/Amazeriffic/server.js | |
+++ b/Chapter6/app/Amazeriffic/server.js | |
@@ -1,5 +1,6 @@ | |
var express = require("express"), | |
http = require("http"), | |
+ bodyParser = require("body-parser"), | |
app = express(), | |
toDos = [ | |
{ | |
@@ -32,7 +33,7 @@ app.use(express.static(__dirname + "/client")); | |
// tell Express to parse incoming | |
// JSON objects | |
-app.use(express.urlencoded()); | |
+app.use(bodyParser.json()); | |
http.createServer(app).listen(3000); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To get these changes to work, you'll need to run