We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 094353f commit 16df130Copy full SHA for 16df130
1 file changed
routes/index.js
@@ -5,15 +5,15 @@ var bodyParser = require('body-parser');
5
var mcapi = require('mailchimp-api');
6
7
mc = new mcapi.Mailchimp(process.env.MAILCHIMP_API);
8
-var parseForm = bodyParser.urlencoded({ extended: false });
+var parseJson = bodyParser.json();
9
10
/* GET home page. */
11
router.get('/', function(req, res, next) {
12
res.render('index');
13
});
14
15
/* POST subscribe an email to JS5 list. */
16
-router.post('/subscribe', parseForm, function(req, res) {
+router.post('/subscribe', parseJson, function(req, res) {
17
mc.lists.subscribe(
18
{
19
id: process.env.LIST_ID,
0 commit comments