diff --git a/lib/application.js b/lib/application.js index c57d541..b26f354 100644 --- a/lib/application.js +++ b/lib/application.js @@ -72,11 +72,13 @@ app.listen = function(){ /** * Return JSON representation. + * We only bother showing settings. * * @return {Object} * @api public */ +app.inspect = app.toJSON = function(){ return only(this, [ 'subdomainOffset', diff --git a/lib/context.js b/lib/context.js index 2b0b084..02b85d5 100644 --- a/lib/context.js +++ b/lib/context.js @@ -13,6 +13,18 @@ var http = require('http'); var proto = module.exports = { + /** + * util.inspect() implementation, which + * just returns the JSON output. + * + * @return {Object} + * @api public + */ + + inspect: function(){ + return this.toJSON(); + }, + /** * Return JSON representation. * @@ -28,7 +40,12 @@ var proto = module.exports = { toJSON: function(){ return { request: this.request.toJSON(), - response: this.response.toJSON() + response: this.response.toJSON(), + app: this.app.toJSON(), + originalUrl: this.originalUrl, + req: '', + res: '', + socket: '', } },