/provider/cloudfront

The cloudfront provider module exports a method to fetch resources from an AWS cloudfront service.

Requires

Methods

(async, inner) cloudfront(ref) → {Promise.<(String|JSON|Buffer|Error)>}

The method creates a signed URL for a cloudfront resource, fetches the resource and returns the fetched resource.

A buffer is returned with the ref.params.buffer flag.

JSON is returned if the URL path matches the .json file ending to fetch a JSON resource from the cloudfront service.

The fetch response will be parsed as text by default.

Parameters:
NameTypeDescription
refObject | string

Reference object or URL string.

Properties
NameTypeAttributesDescription
ref.paramsObject<optional>

Optional parameters for the request.

params.urlstring<optional>

Cloudfront resource URL.

params.signedURLboolean<optional>

Return a signedURL only.

params.bufferboolean<optional>

Return a buffer from the fetch.

Returns:

The method resolves to either JSON, Text, or Buffer dependent ref.params.

Type: 
Promise.<(String|JSON|Buffer|Error)>