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:
parent
b249e14a66
commit
b1a396d9c5
2 changed files with 9 additions and 2 deletions
|
@ -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;
|
||||
|
|
|
@ -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`,
|
||||
|
|
Loading…
Add table
Reference in a new issue