From c71e8dc829256e815be53245fcc70fff794ee981 Mon Sep 17 00:00:00 2001 From: Alex Kocharin Date: Sun, 16 Nov 2014 16:32:46 +0300 Subject: [PATCH] enable web interface by default --- conf/default.yaml | 8 -------- lib/index.js | 8 +++----- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/conf/default.yaml b/conf/default.yaml index 6354d0c13..7b3aa2b56 100644 --- a/conf/default.yaml +++ b/conf/default.yaml @@ -9,14 +9,6 @@ # path to a directory with all packages storage: ./storage -web: - # web interface is disabled by default in 0.x, will be enabled soon in 1.x - # when all its issues will be fixed - # - # set this to `true` if you want to experiment with web ui now; - # this has a lot of issues, e.g. no auth yet, so use at your own risk - #enable: true - auth: htpasswd: file: ./htpasswd diff --git a/lib/index.js b/lib/index.js index af5a2d31b..75e58b6e9 100644 --- a/lib/index.js +++ b/lib/index.js @@ -87,12 +87,10 @@ module.exports = function(config_hash) { app.use(require('./index-api')(config, auth, storage)) - if (config.web && config.web.enable) { - app.use(require('./index-web')(config, auth, storage)) + if (config.web && config.web.enable === false) { + next( Error[404]('web interface is disabled in the config file') ) } else { - app.get('/', function(req, res) { - next( Error[404]('web interface is disabled in the config file') ) - }) + app.use(require('./index-web')(config, auth, storage)) } app.get('/*', function(req, res, next) {