How to use the microgateway-config.init function in microgateway-config

To help you get started, we’ve selected a few microgateway-config 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 apigee-internal / microgateway / cli / lib / configure.js View on Github external
targetFile = configLocations.getSourceFile(options.org, options.env);
  const cache = configLocations.getCachePath(options.org, options.env);
  if (fs.existsSync(cache)) {
    fs.unlinkSync(cache);
    //writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'deleted ' + cache);
  }

  const targetPath = configLocations.getSourcePath(options.org, options.env);
  if (fs.existsSync(targetPath)) {
    fs.unlinkSync(targetPath);
    //writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'deleted ' + targetPath);
  }

  var configFileDirectory = options.configDir || configLocations.homeDir;
  //writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP}, 'init config');
  edgeconfig.init({
    source: configLocations.getDefaultPath(options.configDir),
    targetDir: configFileDirectory,
    targetFile: targetFile,
    overwrite: true
  }, function (/* err, configPath */) {
    options.deployed = false;
    deployAuth.checkDeployedProxies(options, (err, options) => {
      if (err) {
        writeConsoleLog('error',{component: CONSOLE_LOG_TAG_COMP}, err);
        if ( cb ) { cb(err) } else process.exit(1);
        return;
      }
      configureEdgemicroWithCreds(options, (err) => {
        if (err) {
          writeConsoleLog('error',{component: CONSOLE_LOG_TAG_COMP}, err);
          if ( cb ) { cb(err) } else process.exit(1);

microgateway-config

Apigee Microgateway Handler

Apache-2.0
Latest version published 14 days ago

Package Health Score

67 / 100
Full package analysis

Similar packages