forked from external-repos/pa11y-dashboard
Disable search engine indexing by default
This commit is contained in:
12
app.js
12
app.js
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user