0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00

fix: Param web.title from config.yaml does not work on docker image #265

This commit is contained in:
Juan Picado @jotadeveloper 2017-07-27 07:35:47 +02:00
parent b249e14a66
commit b1a396d9c5
No known key found for this signature in database
GPG key ID: 18AC54485952D158
2 changed files with 9 additions and 2 deletions

View file

@ -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;

View file

@ -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`,