DigitalBitsTomlResolver

DigitalBitsTomlResolver

DigitalBitsTomlResolver allows resolving digitalbits.toml files.

Constructor

new DigitalBitsTomlResolver()

Source:

Methods

(static) resolve(domain, optsopt) → {Promise}

Returns a parsed digitalbits.toml file for a given domain.

DigitalBitsSdk.DigitalBitsTomlResolver.resolve('acme.com')
  .then(digitalBitsToml => {
    // digitalBitsToml in an object representing domain digitalbits.toml file.
  })
  .catch(error => {
    // digitalbits.toml does not exist or is invalid
  });
Source:
See:
Parameters:
Name Type Attributes Description
domain string

Domain to get digitalbits.toml file for

opts object <optional>

Options object

Name Type Attributes Description
allowHttp boolean <optional>

Allow connecting to http servers, default: false. This must be set to false in production deployments!

timeout number <optional>

Allow a timeout, default: 0. Allows user to avoid nasty lag due to TOML resolve issue.

Returns:
Type:
Promise

A Promise that resolves to the parsed digitalbits.toml object