bin/serve.js
function loadRemoteJson(options, done) {
	var requestOptions = {
		url: options.url,
		headers: options.headers
	};
	var error;

	request(requestOptions, function (err, response, body) {
		if (err) {
			return done(error);
		}
		if (response.statusCode < 200 || response.statusCode >= 300) {
			error = new Error('Remote JSON responded with ' + response.statusCode + ' status');
			error.status = response.statusCode;
			return done(error);
		}
		try {
			body = JSON.parse(body);
		} catch (err) {
			return done(err);
		}
		done(null, body);
	});
}
function loadRemoteJson(options, done) {
	var requestOptions = {
		url: options.url,
		headers: options.headers
	};
	var error;

	request(requestOptions, function (err, response, body) {
		if (err) {
			return done(error);
		}
		if (response.statusCode < 200 || response.statusCode >= 300) {
			error = new Error('Remote JSON responded with ' + response.statusCode + ' status');
			error.status = response.statusCode;
			return done(error);
		}
		try {
			body = JSON.parse(body);
		} catch (err) {
			return done(err);
		}
		done(null, body);
	});
}
function loadRemoteJson ( options , done ) { var requestOptions = { url : options . url , headers : options . headers } ; var error ; request ( requestOptions , function ( err , response , body ) { if ( err ) { return done ( error ) ; } if ( response . statusCode < 200 || response . statusCode >= 300 ) { error = new Error ( 'Remote JSON responded with ' + response . statusCode + ' status' ) ; error . status = response . statusCode ; return done ( error ) ; } try { body = JSON . parse ( body ) ; } catch ( err ) { return done ( err ) ; } done ( null , body ) ; } ) ; }
Load remote JSON
Load remote JSON