Skip to content

Commit b1a396d

Browse files
committed
fix: Param web.title from config.yaml does not work on docker image #265
1 parent b249e14 commit b1a396d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/api/web/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,15 @@ module.exports = function(config, auth, storage) {
3939

4040
router.get('/', function(req, res) {
4141
const base = Utils.combineBaseUrl(Utils.getWebProtocol(req), req.get('host'), config.url_prefix);
42+
const defaultTitle = 'Verdaccio';
43+
let webPage = template
44+
.replace(/ToReplaceByVerdaccio/g, base)
45+
.replace(/ToReplaceByTitle/g, _.isNil(config.web.title) ? defaultTitle : config.web.title)
46+
.replace(/(main.*\.js|style.*\.css)/g, `${base}/-/static/$1`);
47+
4248
res.setHeader('Content-Type', 'text/html');
43-
res.send(template.replace(/ToReplaceByVerdaccio/g, base).replace(/(main.*\.js|style.*\.css)/g, `${base}/-/static/$1`));
49+
50+
res.send(webPage);
4451
});
4552

4653
return router;

tools/webpack.prod.config.babel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const prodConf = {
2828
}),
2929
new ExtractTextPlugin('style.[contenthash].css'),
3030
new HTMLWebpackPlugin({
31-
title: 'Verdaccio',
31+
title: 'ToReplaceByTitle',
3232
filename: 'index.html',
3333
verdaccioURL: 'ToReplaceByVerdaccio',
3434
template: `${env.SRC_ROOT}/webui/template/index.html`,

0 commit comments

Comments
 (0)