Adding body-parser to parse JSON

This commit is contained in:
snugghash 2017-06-11 11:53:57 +05:30
parent b750bbfda3
commit 3932bbbe10
2 changed files with 5 additions and 1 deletions

View File

@ -20,8 +20,11 @@ const eth = new Eth(provider);
var express = require('express'), var express = require('express'),
cors = require('cors'), cors = require('cors'),
app = express(); app = express(),
bodyParser = require('body-parser'),
jsonParser = bodyParser.json();
app.use(jsonParser);
app.use(cors()); app.use(cors());
// Receive a POST request at the address specified by an env. var. // Receive a POST request at the address specified by an env. var.

View File

@ -10,6 +10,7 @@
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"body-parser": "^1.17.2",
"cors": "^2.8.1", "cors": "^2.8.1",
"ethjs-provider-signer": "^0.1.4", "ethjs-provider-signer": "^0.1.4",
"ethjs-query": "^0.2.4", "ethjs-query": "^0.2.4",