Account for https registry URLs

This commit is contained in:
Wes Mason
2016-05-10 21:50:11 +01:00
parent 1df6d6d94a
commit e4d13bebe0
3 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -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 );
}
+1 -1
View File
@@ -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' ){
+5 -1
View File
@@ -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 );
});
};