}).join('\n')
}
/**
* Return table rows for headers _hash_.
* Return table rows for _hash_.
*
* @param {hash} hash
* @return {string}
* @api private
*/
function headers(hash) {
function hash(hash) {
if (!$(hash).length()) return '<tr><td class="empty" colspan="2">Empty</td></tr>'
return $(hash).map(function(val, key){
return '<tr><td>' + key + ':</td><td>' + val + '</td></tr>'
return '<tr><td>' + key + ':</td><td>' + JSON.encode(val) + '</td></tr>'
}).join('\n')
}
exports.render = function(request, e) {
' + stack(e) + ' \n\
</ul> \n\
<h3>Request</h3> \n\
<table id="request-headers"> \n\
' + headers(request.headers) + ' \n\
' + hash(request.headers) + ' \n\
</table> \n\
<h3>Response</h3> \n\
<table id="response-headers"> \n\
' + headers(request.response.headers) + '\n\
' + hash(request.response.headers) + ' \n\
</table> \n\
<h3>Params</h3> \n\
<table id="route-params"> \n\
' + hash(request.params) + ' \n\
</table> \n\
<h3>GET</h3> \n\
<table id="get-params"> \n\
' + hash(request.uri.params) + ' \n\
</table> \n\
<h3>POST</h3> \n\
<table id="post-params"> \n\
' + hash(request.uri.post) + ' \n\
</table> \n\
</div> \n\
</body> \n\
</html>'
}
No newline at end of file
No newline at end of file