otto-config
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,3 +5,2 @@ | ||
// Modules | ||
var path = require('path'); | ||
var logger = require('morgan'); | ||
@@ -44,4 +43,7 @@ var body_parser = require('body-parser'); | ||
// Set View Options | ||
app.set('views', path.join(__dirname, 'views')); | ||
app.set('view engine', 'ejs'); | ||
if (config.views) { | ||
if (!config.views.type) { config.views.type = 'ejs'; } | ||
app.set('view engine', config.views.type); | ||
app.set('views', config.views.path); | ||
} | ||
@@ -51,3 +53,2 @@ // Log Requests | ||
if (config.logging === true) { | ||
console.log('Starting Logger...'); | ||
// Long version of 'dev' | ||
@@ -54,0 +55,0 @@ app.use(logger(':date :remote-addr :method :status :url')); |
{ | ||
"name" : "otto-config", | ||
"version" : "0.1.0", | ||
"version" : "0.1.1", | ||
"repository" : "https://github.com/ottojs/otto-config.git", | ||
@@ -8,3 +8,3 @@ "main" : "./lib/index.js", | ||
"morgan" : "1.5.0", | ||
"body-parser" : "1.9.3", | ||
"body-parser" : "1.10.0", | ||
"method-override" : "2.3.0" | ||
@@ -15,4 +15,4 @@ }, | ||
"mocha" : "2.0.1", | ||
"should" : "4.3.0", | ||
"istanbul" : "0.3.2" | ||
"should" : "4.3.1", | ||
"istanbul" : "0.3.5" | ||
}, | ||
@@ -19,0 +19,0 @@ "scripts" : { |
@@ -99,2 +99,64 @@ | ||
describe('views', function () { | ||
it('should not use views by default', function () { | ||
var settings = {}; | ||
config.global({ | ||
use : function () {}, | ||
set : function (key, value) { | ||
settings[key] = value; | ||
} | ||
}, {}, {}); | ||
settings.should.not.have.property('view engine'); | ||
settings.should.not.have.property('views'); | ||
}); | ||
it('should use the provided path for the views', function () { | ||
var settings = {}; | ||
config.global({ | ||
use : function () {}, | ||
set : function (key, value) { | ||
settings[key] = value; | ||
} | ||
}, {}, { | ||
views : { | ||
path : '/path/to/views' | ||
} | ||
}); | ||
settings.should.have.property('views').and.equal('/path/to/views'); | ||
}); | ||
it('should use ejs as the default view engine type', function () { | ||
var settings = {}; | ||
config.global({ | ||
use : function () {}, | ||
set : function (key, value) { | ||
settings[key] = value; | ||
} | ||
}, {}, { | ||
views : { | ||
path : '/path/to/views' | ||
} | ||
}); | ||
settings.should.have.property('view engine').and.equal('ejs'); | ||
}); | ||
it('should use a custom engine when provided', function () { | ||
var settings = {}; | ||
config.global({ | ||
use : function () {}, | ||
set : function (key, value) { | ||
settings[key] = value; | ||
} | ||
}, {}, { | ||
views : { | ||
type : 'custom', | ||
path : '/path/to/views' | ||
} | ||
}); | ||
settings.should.have.property('view engine').and.equal('custom'); | ||
}); | ||
}); | ||
describe('logger', function () { | ||
@@ -101,0 +163,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10284
230
+ Addedbody-parser@1.10.0(transitive)
- Removedbody-parser@1.9.3(transitive)
Updatedbody-parser@1.10.0