mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-27 22:59:51 -05:00
Merge branch 'master' of github.com:verdaccio/verdaccio
This commit is contained in:
commit
4bb6a223be
2 changed files with 15 additions and 4 deletions
|
@ -1,5 +1,6 @@
|
|||
var Handlebars = require('handlebars')
|
||||
var request = require('request')
|
||||
var Logger = require('./logger')
|
||||
|
||||
module.exports.notify = function(metadata, config) {
|
||||
|
||||
|
@ -22,7 +23,16 @@ module.exports.notify = function(metadata, config) {
|
|||
options.url = config.notify.endpoint
|
||||
}
|
||||
|
||||
request(options);
|
||||
request(options, function(err, response, body) {
|
||||
if (err) {
|
||||
Logger.logger.error( { err: err }, ' notify error: @{err.message}' );
|
||||
} else {
|
||||
Logger.logger.info({ content: content}, 'A notification has been shipped: @{content}')
|
||||
if (body) {
|
||||
Logger.logger.debug( { body: body }, ' body: @{body}' );
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,7 +12,9 @@ function Search() {
|
|||
}
|
||||
|
||||
Search.prototype.query = function(q) {
|
||||
return this.index.search(q)
|
||||
return q === '*'
|
||||
? this.storage.config.localList.get().map( function( package ){ return { ref: package, score: 1 }; } )
|
||||
: this.index.search(q);
|
||||
}
|
||||
|
||||
Search.prototype.add = function(package) {
|
||||
|
@ -45,4 +47,3 @@ Search.prototype.configureStorage = function(storage) {
|
|||
}
|
||||
|
||||
module.exports = Search()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue