diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-29 20:22:56 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-07-29 20:22:56 +0200 |
commit | 5fb708a874ea85f483f272ad29f78d45c7bf5526 (patch) | |
tree | ff7ac53e477c1c4f7fe183791a152e2027d4e189 | |
parent | 9ae22f10ce3cbcfad91668ca7234058c0a55550f (diff) | |
download | collection-json-explorer-master.tar.gz collection-json-explorer-master.tar.bz2 collection-json-explorer-master.tar.xz collection-json-explorer-master.zip |
-rw-r--r-- | routes/index.js | 8 | ||||
-rw-r--r-- | views/data.jade | 1 |
2 files changed, 5 insertions, 4 deletions
diff --git a/routes/index.js b/routes/index.js index fff06b6..8475824 100644 --- a/routes/index.js +++ b/routes/index.js @@ -117,15 +117,15 @@ exports.write = function(req, res) { options.headers = { 'Content-Type': 'application/vnd.collection+json' }; -// console.log('options', options); + // console.log('options', options); -// console.log('params', extractParams(req.body)); var data = _.map(extractParams(req.body), function(value, key) { return {name: key, value: value}; }); var body = {template: { data: data }}; -// console.log('body', JSON.stringify(body)); + // console.log('body', JSON.stringify(body, null, ' ')); function done(message, httpResponse) { + // console.log('done', arguments); var parsedBody; try { parsedBody = JSON.parse(httpResponse.body); @@ -136,7 +136,7 @@ exports.write = function(req, res) { root: collection_json.fromObject(parsedBody), httpResponse: httpResponse, parsedBody: parsedBody, - rawBody: httpResponse.body + rawBody: typeof httpResponse == 'object' ? httpResponse.body : undefined, }); } var httpRequest = http.request(options, function(httpResponse) { diff --git a/views/data.jade b/views/data.jade index 13915cc..21a90c0 100644 --- a/views/data.jade +++ b/views/data.jade @@ -402,6 +402,7 @@ block inner_content block content - var collection = root.collection + - var params = params || {} div(class='row-fluid') div(class='span3') block sidebar |