How to use the moesifapi.ApiController.getAppConfig function in moesifapi

To help you get started, we’ve selected a few moesifapi 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 Moesif / moesif-express / lib / moesifConfigManager.js View on Github external
MoesifConfigManager.prototype.tryGetConfig = function () {
  if (!this._loadingConfig && this.shouldFetchConfig()) {
    // only send one config request at a time
    this._loadingConfig = true;

    var that = this;

    moesifController.getAppConfig(function (_, __, event) {
      that._loadingConfig = false;

      if (event && event.response.statusCode === 200) {
        that._configHash = event.response.headers[HASH_HEADER];
        try {
          that._config = JSON.parse(event.response.body);
          that._lastConfigUpdate = now();
        } catch (e) {
          console.warn('moesif-express: error parsing config');
        }
      }
    });
  }
};

moesifapi

Collection/Data Ingestion API for Moesif

Apache-2.0
Latest version published 4 months ago

Package Health Score

65 / 100
Full package analysis