Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

otto-config

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

otto-config - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

9

lib/index.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc