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()
new FaasBrowserClient(
baseUrl
,options
):FaasBrowserClient
Parameters
• baseUrl: `${string}/` = '/'
• options: Options
= ...
Returns
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's path or react's server action
• params?: FaasParams
<PathOrData
>
function's params
• options?: Options
request options
await client.action('func', { key: 'value' })
Returns
Promise
<Response
<FaasData
<PathOrData
>>>
Properties
baseUrl
baseUrl: `${string}/`
defaultOptions
defaultOptions:
Options
id
readonly
id:string