Skip to content
Myr

No 'json spaces' by default

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Json rendering can be handled by user tools or overridden in their own app to behave as desired. Minimizes the use of magic env settings.

authored by Roman Shtylman · committed by Roman Shtylman · parent 8c3f153 · Browse files · 3 files+4 added−22 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−22 removed

  • tests:+4 added−18 removed
  • other:+0 added−4 removed

3 files+4 added−22 removed

modified:lib/application.js-4 removed
80 unmodified lines
81 this.set('view', View);82 this.set('views', process.cwd() + '/views');83 this.set('jsonp callback name', 'callback');8485 this.configure('development', function(){86 this.set('json spaces', 2);87 });8885 if (this.get('env') === 'production') {86 this.enable('view cache');87 };88};
442 unmodified lines
modified:test/res.json.js+3 added-10 removed
modified:test/res.jsonp.js+1 added-8 removed
179 unmodified lines
180 })181 })182183 describe('"json spaces" setting', function(){184 it('should default to 2 in development', function(){185 process.env.NODE_ENV = 'development';184 it('should be undefined by default', function(){185 var app = express();187 app.get('json spaces').should.equal(2);188 process.env.NODE_ENV = 'test';189 })190191 it('should be undefined otherwise', function(){192 var app = express();186 assert(undefined === app.get('json spaces'));187 })188189 it('should be passed to JSON.stringify()', function(done){
56 unmodified lines