Disable search engine indexing by default

This commit is contained in:
Rowan Manning
2013-11-15 15:58:49 +00:00
parent 85b70c5679
commit 55d44685e9
5 changed files with 20 additions and 3 deletions

12
app.js
View File

@@ -11,6 +11,7 @@ module.exports = initApp;
// Initialise the application
function initApp (config, callback) {
config = defaultConfig(config);
var app = new EventEmitter();
app.address = null;
@@ -51,7 +52,8 @@ function initApp (config, callback) {
year: (new Date()).getFullYear(),
version: pkg.version,
repo: pkg.homepage,
bugtracker: pkg.bugs
bugtracker: pkg.bugs,
noindex: config.noindex
});
app.express.use(function (req, res, next) {
res.locals.isHomePage = (req.path === '/');
@@ -93,3 +95,11 @@ function initApp (config, callback) {
});
}
// Get default configurations
function defaultConfig (config) {
if (typeof config.noindex !== 'boolean') {
config.noindex = true;
}
return config;
}