Skip to content

Commit

Permalink
refactor code in one example
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoChiesa committed Dec 8, 2017
1 parent 923a99c commit a725bcd
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions examples/findApiProductForProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ------------------------------------------------------------------
//
// created: Mon Mar 20 09:57:02 2017
// last saved: <2017-December-07 18:19:37>
// last saved: <2017-December-07 18:30:02>

var edgejs = require('apigee-edge-js'),
common = edgejs.utility,
Expand All @@ -14,24 +14,25 @@ var edgejs = require('apigee-edge-js'),
['T' , 'notoken', 'Optional. do not try to obtain a login token.']
])).bindHelp();

console.log(
'Apigee Edge findApiProductForProxy.js tool, version: ' + version + '\n' +
'Node.js ' + process.version + '\n');

common.logWrite('start');

// process.argv array starts with 'node' and 'scriptname.js'
var opt = getopt.parse(process.argv.slice(2));

function handleError(e) {
if (e) {
console.log(e);
console.log(e.stack);
process.exit(1);
}
}

// ========================================================

console.log(
'Apigee Edge findApiProductForProxy.js tool, version: ' + version + '\n' +
'Node.js ' + process.version + '\n');

common.logWrite('start');

// process.argv array starts with 'node' and 'scriptname.js'
var opt = getopt.parse(process.argv.slice(2));

common.verifyCommonRequiredParameters(opt.options, getopt);

if ( !opt.options.proxy ) {
Expand Down

0 comments on commit a725bcd

Please sign in to comment.