Wes Mason
9 years ago
No known key found for this signature in database
GPG Key ID: 121DB7952C93970C
3 changed files with
7 additions and
3 deletions
-
bin/www
-
config.js
-
utils.js
|
|
@ -82,5 +82,5 @@ function onError(error) { |
|
|
|
*/ |
|
|
|
|
|
|
|
function onListening() { |
|
|
|
console.log('Listening on http://' + config.LOCAL_REGISTRY ); |
|
|
|
console.log('Listening on http://0.0.0.0:' + port ); |
|
|
|
} |
|
|
|
|
|
@ -14,7 +14,7 @@ Object.keys( defaultConfig ).forEach( function(v){ |
|
|
|
|
|
|
|
|
|
|
|
if( !config.LOCAL_REGISTRY ){ |
|
|
|
config.LOCAL_REGISTRY = 'localhost:' + config.PORT; |
|
|
|
config.LOCAL_REGISTRY = 'http://localhost:' + config.PORT; |
|
|
|
} |
|
|
|
|
|
|
|
if( config.ENABLE_NPM_FAILOVER == 'false' ){ |
|
|
|
|
|
@ -29,7 +29,11 @@ exports.readFile = readFile; |
|
|
|
exports.patchData = function ( data ){ |
|
|
|
Object.keys(data.versions).forEach( function( v ){ |
|
|
|
var val = data.versions[v]; |
|
|
|
val.dist.tarball = val.dist.tarball.replace( REGISTRY_NAME, LOCAL_REGISTRY ); |
|
|
|
var protocal = 'http://'; |
|
|
|
if( val.dist.tarball.indexOf( 'https:' ) !== false ){ |
|
|
|
protocal = 'https://'; |
|
|
|
} |
|
|
|
val.dist.tarball = val.dist.tarball.replace( protocal + REGISTRY_NAME, LOCAL_REGISTRY ); |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|