apigeetool
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -40,2 +40,6 @@ /* jshint node: true */ | ||
}, | ||
virtualhosts: { | ||
name: 'Virtual Hosts', | ||
shortOption: 'v' | ||
}, | ||
'base-path': { | ||
@@ -321,4 +325,8 @@ name: 'Base Path', | ||
function createProxy(opts, request, done) { | ||
// TODO virtual host support! | ||
var vhost = 'default'; | ||
var vhostStr = (opts.virtualhosts ? opts.virtualhosts : 'default'); | ||
// Create an array of objects for underscore | ||
var vhosts = _.map(vhostStr.split(','), function(i) { | ||
return { name: i }; | ||
}); | ||
var basepath = (opts['base-path'] ? opts['base-path'] : '/'); | ||
@@ -330,3 +338,3 @@ | ||
'<BasePath>{{basepath}}</BasePath>' + | ||
'<VirtualHost>{{vhost}}</VirtualHost>' + | ||
'{{#vhosts}}<VirtualHost>{{name}}</VirtualHost>{{/vhosts}}' + | ||
'</HTTPProxyConnection>' + | ||
@@ -337,5 +345,9 @@ '<RouteRule name="default">' + | ||
'</ProxyEndpoint>', { | ||
vhost: vhost, | ||
vhosts: vhosts, | ||
basepath: basepath | ||
}); | ||
if (opts.debug) { | ||
console.log('vhosts = %j', vhosts); | ||
console.log('proxy = %s', targetDoc); | ||
} | ||
@@ -342,0 +354,0 @@ var uri = util.format('%s/v1/o/%s/apis/%s/revisions/%d/proxies?name=default', |
@@ -42,3 +42,3 @@ /* jshint node: true */ | ||
name: 'Verbose', | ||
shortOption: 'v', | ||
shortOption: 'V', | ||
toggle: true | ||
@@ -45,0 +45,0 @@ }, |
@@ -84,3 +84,3 @@ /* jshint node: true */ | ||
var desc = descriptor[propName]; | ||
if (!desc) { | ||
if (desc === null || desc === undefined) { | ||
done(new Error(util.format('Invalid property %s', propName))); | ||
@@ -87,0 +87,0 @@ return; |
{ | ||
"name": "apigeetool", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "A CLI for Apigee Edge", | ||
@@ -5,0 +5,0 @@ "main": "lib/main.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58023
1916