diff --git a/lib/application.js b/lib/application.js index f1e1374..ef3533e 100644 --- a/lib/application.js +++ b/lib/application.js @@ -46,6 +46,7 @@ function Application() { this.env = process.env.NODE_ENV || 'development'; this.subdomainOffset = 2; this.middleware = []; + this.proxy = false; this.context = Object.create(context); this.request = Object.create(request); this.response = Object.create(response); @@ -85,6 +86,7 @@ app.inspect = app.toJSON = function(){ return only(this, [ 'subdomainOffset', + 'proxy', 'env' ]); }; diff --git a/test/application.js b/test/application.js index 91bfade..0c1947c 100644 --- a/test/application.js +++ b/test/application.js @@ -67,6 +67,7 @@ describe('app.toJSON()', function(){ obj.should.eql({ subdomainOffset: 2, + proxy: false, env: 'test' }); }) @@ -77,6 +78,7 @@ describe('app.inspect()', function(){ var app = koa(); var util = require('util'); var str = util.inspect(app); + assert.equal("{ subdomainOffset: 2, proxy: false, env: 'test' }", str); }) })