0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-04-15 03:02:51 -05:00

Merge pull request #266 from verdaccio/fix_265

fix: Param web.title from config.yaml does not work on docker image #265
This commit is contained in:
Meeeeow 2017-07-27 19:14:21 +08:00 committed by GitHub
commit a4c829d836
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, _.get(config, 'web.title') ? config.web.title : defaultTitle)
.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`,