mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
Merge pull request #136 from psychocode/fix-webreadme
optional scope in the readme package name.
This commit is contained in:
commit
773ac4922b
1 changed files with 4 additions and 2 deletions
|
@ -150,8 +150,10 @@ module.exports = function(config, auth, storage) {
|
|||
}
|
||||
})
|
||||
|
||||
app.get('/-/readme/:package/:version?', can('access'), function(req, res, next) {
|
||||
storage.get_package(req.params.package, {req: req}, function(err, info) {
|
||||
app.get('/-/readme(/@:scope?)?/:package/:version?', can('access'), function(req, res, next) {
|
||||
var packageName = req.params.package;
|
||||
if (req.params.scope) packageName = "@"+ req.params.scope + "/" + packageName;
|
||||
storage.get_package(packageName, {req: req}, function(err, info) {
|
||||
if (err) return next(err)
|
||||
next( renderReadme(info.readme || 'ERROR: No README data found!') )
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue