How to use @pollyjs/node-server - 5 common examples

To help you get started, we’ve selected a few @pollyjs/node-server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix / pollyjs / packages / @pollyjs / cli / bin / cli.js View on Github external
// Provide a title to the process in `ps`
process.title = 'polly';

const Polly = require('@pollyjs/node-server');
const cli = require('commander');

const version = require('../package.json').version;

cli.name('polly').version(version, '-v, --version');

cli
  .command('listen')
  .alias('l')
  .description('start the server and listen for requests')
  .option('-H, --host ', 'host')
  .option('-p, --port ', 'port number', Polly.Defaults.port)
  .option(
    '-n, --api-namespace ',
    'api namespace',
    Polly.Defaults.apiNamespace
  )
  .option(
    '-d, --recordings-dir 
github Netflix / pollyjs / packages / @pollyjs / cli / bin / cli.js View on Github external
cli
  .command('listen')
  .alias('l')
  .description('start the server and listen for requests')
  .option('-H, --host ', 'host')
  .option('-p, --port ', 'port number', Polly.Defaults.port)
  .option(
    '-n, --api-namespace ',
    'api namespace',
    Polly.Defaults.apiNamespace
  )
  .option(
    '-d, --recordings-dir 
github Netflix / pollyjs / packages / @pollyjs / ember / index.js View on Github external
let config = {
      enabled: env !== 'production',
      server: {}
    };

    let configPath = path.join(this.root, 'config', 'polly.js');

    if (fs.existsSync(configPath)) {
      let configGenerator = require(configPath);

      Object.assign(config, configGenerator(env));
    }

    config.server.recordingsDir = path.join(
      this.root,
      config.server.recordingsDir || Defaults.recordingsDir
    );

    return config;
  },
github Netflix / pollyjs / packages / @pollyjs / cli / bin / cli.js View on Github external
.action(function(options) {
    new Polly.Server(options).listen();
  });
github Netflix / pollyjs / packages / @pollyjs / ember / index.js View on Github external
testemMiddleware(app) {
    if (this._config.enabled) {
      registerExpressAPI(app, this._config.server);
    }
  }
};

@pollyjs/node-server

Standalone node server and express integration for @pollyjs

Apache-2.0
Latest version published 9 months ago

Package Health Score

67 / 100
Full package analysis