From 27ee62b7559d4785740f91cb1e204d64263f394d Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 4 Nov 2015 12:26:20 -0500 Subject: [PATCH] Fixed bug with parsing urlencoded post data. --- lib/index.js | 3 +++ package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/lib/index.js b/lib/index.js index 66c88ddfd..e477b3f61 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,5 +1,6 @@ 'use strict'; +var bodyParser = require('body-parser'); var BaseService = require('./service'); var inherits = require('util').inherits; var BlockController = require('./blocks'); @@ -86,6 +87,8 @@ InsightAPI.prototype.start = function(callback) { InsightAPI.prototype.setupRoutes = function(app) { + app.use(bodyParser.urlencoded({extended: true})); + //Enable CORS app.use(function(req, res, next) { res.header('Access-Control-Allow-Origin', '*'); diff --git a/package.json b/package.json index b5c2b9a57..805a8b213 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "async": "*", "bitcore-lib": "^0.13.7", "bitcore-message": "^1.0.1", + "body-parser": "^1.13.3", "lodash": "^2.4.1", "request": "^2.64.0" },