Documents / @faasjs/browser / FaasBrowserClient

Class: FaasBrowserClient

FaasJS browser client

const client = new FaasBrowserClient('http://localhost:8080')

await client.action('func', { key: 'value' })

Constructors

new FaasBrowserClient(baseUrl, options)

new FaasBrowserClient(baseUrl, options?): FaasBrowserClient

Parameters

baseUrl: string

options?: Options

Returns

FaasBrowserClient

Properties

defaultOptions

defaultOptions: Options

host

host: string

id

readonly id: string

Methods

action()

action<PathOrData>(action, params?, options?): Promise<Response<FaasData<PathOrData>>>

Request a FaasJS function

Type parameters

PathOrData extends FaasAction

Parameters

action: string | PathOrData

function path

params?: FaasParams<PathOrData>

function params

options?: Options

request options

await client.action('func', { key: 'value' })

Returns

Promise<Response<FaasData<PathOrData>>>