diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-30 18:57:30 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-30 18:57:30 +0200 |
commit | 7f3be1a0048f2ddd2cdda9ab17e2316a6bdeee0d (patch) | |
tree | d3098dccc47215ea2aea67ae0bb3261043ae6f55 /routes | |
parent | aab2a2e598a435092c95f1ba26ff35866ebdcdfc (diff) | |
download | collection-json-explorer-7f3be1a0048f2ddd2cdda9ab17e2316a6bdeee0d.tar.gz collection-json-explorer-7f3be1a0048f2ddd2cdda9ab17e2316a6bdeee0d.tar.bz2 collection-json-explorer-7f3be1a0048f2ddd2cdda9ab17e2316a6bdeee0d.tar.xz collection-json-explorer-7f3be1a0048f2ddd2cdda9ab17e2316a6bdeee0d.zip |
o Twitter Bootstrap <3.
Diffstat (limited to 'routes')
-rw-r--r-- | routes/index.js | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/routes/index.js b/routes/index.js index bceafc3..a5b1bdc 100644 --- a/routes/index.js +++ b/routes/index.js @@ -13,15 +13,7 @@ function urlgenerator(req) { exports.index = function(req, res){ res.render('index', { title: 'Collection+JSON Explorer', - host: req.headers.host, - examples: [ - "minimal", - "collection", - "item", - "queries", - "template", - "error" - ] + host: req.headers.host }); }; @@ -41,7 +33,7 @@ exports.render = function(req, res) { try { parsedBody = JSON.parse(body); } catch(e) { sendErr('Unable to parse JSON: ' + e); } - var doc = collection_json.fromObject(parsedBody).collection; + var collection = collection_json.fromObject(parsedBody).collection; var isUrl = function(u) { try { var x = url.parse(u); @@ -55,10 +47,10 @@ exports.render = function(req, res) { isUrl: isUrl, urlgenerator: urlgenerator(req), url: req.query.url, - doc: doc, + collection: collection, headers: headers, - raw: body, - formattedRaw: JSON.stringify(parsedBody, null, ' ') }); + rawBody: body, + formattedBody: JSON.stringify(parsedBody, null, ' ') }); } }); }; |