tooling/util/proxies.js
async function start(service) {
  return new Promise((resolve) => {
    const snapshotsDir = path.join(__dirname, '../../test/services/', service.name, 'snapshots');
    const app = yakbak(service.defaultUrl, {
      dirname: snapshotsDir,
      hash: customHash
    });
    const proxy = http.createServer(app).listen(service.port, () => {
      console.log(`Yakbak server listening on port ${service.port}. Proxy for ${service.defaultUrl}`);
    });

    resolve(proxy);
  });
}
async function start(service) {
  return new Promise((resolve) => {
    const snapshotsDir = path.join(__dirname, '../../test/services/', service.name, 'snapshots');
    const app = yakbak(service.defaultUrl, {
      dirname: snapshotsDir,
      hash: customHash
    });
    const proxy = http.createServer(app).listen(service.port, () => {
      console.log(`Yakbak server listening on port ${service.port}. Proxy for ${service.defaultUrl}`);
    });

    resolve(proxy);
  });
}
async function start ( service ) { return new Promise ( ( resolve ) => { const snapshotsDir = path . join ( __dirname , '../../test/services/' , service . name , 'snapshots' ) ; const app = yakbak ( service . defaultUrl , { dirname : snapshotsDir , hash : customHash } ) ; const proxy = http . createServer ( app ) . listen ( service . port , ( ) => { console . log ( ` ${ service . port } ${ service . defaultUrl } ` ) ; } ) ; resolve ( proxy ) ; } ) ; }
Starts a proxy server for the given service.
@param {Service} service
@returns {Promise|http.server} proxy server
Starts a proxy server for the given service .