Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Settings functionality moved out of core #3218

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/auth/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var app = module.exports = express();

// config

app.set('view engine', 'ejs');
app.set('views', __dirname + '/views');
app.settings.set('view engine', 'ejs');
app.settings.set('views', __dirname + '/views');

// middleware

Expand Down
4 changes: 2 additions & 2 deletions examples/ejs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ app.engine('.html', require('ejs').__express);

// Optional since express defaults to CWD/views

app.set('views', __dirname + '/views');
app.settings.set('views', __dirname + '/views');

// Without this you would need to
// supply the extension to res.render()
// ex: res.render('users.html').
app.set('view engine', 'html');
app.settings.set('view engine', 'html');

// Dummy users
var users = [
Expand Down
8 changes: 4 additions & 4 deletions examples/error-pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ var logger = require('morgan');
var silent = 'test' == process.env.NODE_ENV;

// general config
app.set('views', __dirname + '/views');
app.set('view engine', 'ejs');
app.settings.set('views', __dirname + '/views');
app.settings.set('view engine', 'ejs');

// our custom "verbose errors" setting
// which we can use in the templates
// via settings['verbose errors']
app.enable('verbose errors');
app.settings.enable('verbose errors');

// disable them in production
// use $ NODE_ENV=production node examples/error-pages
if ('production' == app.settings.env) app.disable('verbose errors');
if ('production' == app.settings.get('env')) app.settings.disable('verbose errors');

silent || app.use(logger('dev'));

Expand Down
2 changes: 1 addition & 1 deletion examples/error/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
var express = require('../../');
var logger = require('morgan');
var app = module.exports = express();
var test = app.get('env') == 'test';
var test = app.settings.get('env') == 'test';

if (!test) app.use(logger('dev'));

Expand Down
4 changes: 2 additions & 2 deletions examples/markdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ app.engine('md', function(path, options, fn){
});
});

app.set('views', __dirname + '/views');
app.settings.set('views', __dirname + '/views');

// make it the default so we dont need .md
app.set('view engine', 'md');
app.settings.set('view engine', 'md');

app.get('/', function(req, res){
res.render('index', { title: 'Markdown Example' });
Expand Down
4 changes: 2 additions & 2 deletions examples/mvc/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ var app = module.exports = express();

// set our default template engine to "jade"
// which prevents the need for extensions
app.set('view engine', 'jade');
app.settings.set('view engine', 'jade');

// set views for error and 404 pages
app.set('views', __dirname + '/views');
app.settings.set('views', __dirname + '/views');

// define a custom res.message() method
// which stores messages in the session
Expand Down
4 changes: 2 additions & 2 deletions examples/mvc/lib/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ module.exports = function(parent, options){
var path;

// allow specifying the view engine
if (obj.engine) app.set('view engine', obj.engine);
app.set('views', __dirname + '/../controllers/' + name + '/views');
if (obj.engine) app.settings.set('view engine', obj.engine);
app.settings.set('views', __dirname + '/../controllers/' + name + '/views');

// generate routes based
// on the exported methods
Expand Down
4 changes: 2 additions & 2 deletions examples/route-separation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = app;

// Config

app.set('view engine', 'jade');
app.set('views', __dirname + '/views');
app.settings.set('view engine', 'jade');
app.settings.set('views', __dirname + '/views');

/* istanbul ignore next */
if (!module.parent) {
Expand Down
Loading