heroku-data-api
Advanced tools
Comparing version 0.1.0 to 0.2.0
@@ -44,3 +44,10 @@ 'use strict' | ||
if (['PATCH', 'PUT', 'POST'].includes(request.method)) { | ||
request.body = yield fs.readFile('/dev/stdin', 'utf8') | ||
let body = yield fs.readFile('/dev/stdin', 'utf8') | ||
let parsedBody | ||
try { | ||
parsedBody = JSON.parse(body) | ||
} catch(e) { | ||
throw new Error("Request body must be valid JSON") | ||
} | ||
request.body = parsedBody | ||
} | ||
@@ -47,0 +54,0 @@ let response = yield heroku.request(request) |
{ | ||
"name": "heroku-data-api", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "A heroku plugin to communicate with the undocumented, internal, unstable data APIs.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
6173
123