Class: ApiResource

ApiResource()

new ApiResource()

Represents an api resource located under the resources directory deployed within your api
Do not call constructor directly
Bluenimble container creates it internally and makes it available for your services to use

Source:

Members

(readonly) contentType :string

The contentType of this resource if recognized by the container
Type:
  • string
Source:

(readonly) extension :integer

The extension of this resource in case if it's a file
Type:
  • integer
Source:

(readonly) length :integer

The length/size, ie number of bytes of the content of this resource
Type:
  • integer
Source:

(readonly) name :string

The name of this resource
Type:
  • string
Source:

(readonly) path :string

The path of this resource
Type:
  • string
Source:

(readonly) timestamp :Date

The timestamp/lastModifiedDate of this resource
Type:
  • Date
Source:

Methods

children()

Get the children of this resource using a selector
The selector will not apply if this resource represents a file.
Only resources representing folders may have children (files and folders)
Source:

toOutput() → {ApiOutput}

Get an ApiOutput instance from this resource
Source:
Returns:
an api output
Type
ApiOutput

toStream() → {ApiStreamSource}

Get a StreamSource instance from this resource
The return of this function will undefined in case it's a folder
Source:
Returns:
the stream source
Type
ApiStreamSource