Skip to content

Commit

Permalink
fix: Param web.title from config.yaml does not work on docker image #265
Browse files Browse the repository at this point in the history
  • Loading branch information
juanpicado committed Jul 27, 2017
1 parent b249e14 commit b1a396d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion src/api/web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,15 @@ module.exports = function(config, auth, storage) {

router.get('/', function(req, res) {
const base = Utils.combineBaseUrl(Utils.getWebProtocol(req), req.get('host'), config.url_prefix);
const defaultTitle = 'Verdaccio';
let webPage = template
.replace(/ToReplaceByVerdaccio/g, base)
.replace(/ToReplaceByTitle/g, _.isNil(config.web.title) ? defaultTitle : config.web.title)
.replace(/(main.*\.js|style.*\.css)/g, `${base}/-/static/$1`);

res.setHeader('Content-Type', 'text/html');
res.send(template.replace(/ToReplaceByVerdaccio/g, base).replace(/(main.*\.js|style.*\.css)/g, `${base}/-/static/$1`));

res.send(webPage);
});

return router;
Expand Down
2 changes: 1 addition & 1 deletion tools/webpack.prod.config.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const prodConf = {
}),
new ExtractTextPlugin('style.[contenthash].css'),
new HTMLWebpackPlugin({
title: 'Verdaccio',
title: 'ToReplaceByTitle',
filename: 'index.html',
verdaccioURL: 'ToReplaceByVerdaccio',
template: `${env.SRC_ROOT}/webui/template/index.html`,
Expand Down

0 comments on commit b1a396d

Please sign in to comment.