Browse Source

Account for https registry URLs

pull/3/head
Wes Mason 9 years ago
parent
commit
e4d13bebe0
No known key found for this signature in database GPG Key ID: 121DB7952C93970C
  1. 2
      bin/www
  2. 2
      config.js
  3. 6
      utils.js

2
bin/www

@ -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 );
}

2
config.js

@ -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' ){

6
utils.js

@ -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 );
});
};

Loading…
Cancel
Save