Skip to content

Instantly share code, notes, and snippets.

@commuterjoy
Last active April 11, 2016 12:25
Show Gist options
  • Save commuterjoy/3d6c3be63a929caf392e98ff26066448 to your computer and use it in GitHub Desktop.
Save commuterjoy/3d6c3be63a929caf392e98ff26066448 to your computer and use it in GitHub Desktop.
Testing Zuora in production
  1. Make up a simple proxy server (see below).
  2. We give that a DNS entry Eg, next-signup-test-suite.ft.com
  3. Create a single Zuora configuaration, valid for that host.
  4. The proxy server forms a URL from a ft-heroku-backend header sent by each test suite + path of the original request and proxies that request to the temporary Heroku backend.
  5. As long as the proxy server does not cache any requests we should be able to spin up as many concurrent branches as we need.
var https			= require('https');
var app				= require('express');

app.get('/:path*', function(req, res) {
	var url = 'https://' + req.get('ft-heroku-backend') + '/' + req.path;
	https.get(url, function(proxyRes) {
		proxyRes.pipe(res);
	});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment