From da36abcc1e88fd39ccc70c10c31584df67bf797d Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 18 Aug 2014 14:25:50 -0700 Subject: [PATCH] paypro: example - allow user to set options when using example as a module. --- examples/PayPro/server.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/examples/PayPro/server.js b/examples/PayPro/server.js index 83b5d9e..bfcf6d7 100755 --- a/examples/PayPro/server.js +++ b/examples/PayPro/server.js @@ -36,10 +36,6 @@ var TransactionBuilder = bitcore.TransactionBuilder; * Variables */ -var isNode = !argv.b && !argv.browser; - -var app = express(); - var x509 = { priv: fs.readFileSync(__dirname + '/../../test/data/x509.key'), pub: fs.readFileSync(__dirname + '/../../test/data/x509.pub'), @@ -52,6 +48,14 @@ var server = https.createServer({ cert: fs.readFileSync(__dirname + '/../../test/data/x509.crt') }); +server.setOptions = function(options) { + argv = options; +}; + +var isNode = !argv.b && !argv.browser; + +var app = express(); + /** * Ignore Cache Headers * Allow CORS