Skip to content

@sebastianwessel/quickjs v2.1.1


@sebastianwessel/quickjs / GetFetchAdapterOptions

Type Alias: GetFetchAdapterOptions

GetFetchAdapterOptions: object

Defined in: src/adapter/fetch.ts:12

Options for creating the default fetch adapter

Type declaration

allowedCorsOrigins?

optional allowedCorsOrigins: string[]

List of allowed CORS origins

Default

ts
['*']

allowedHosts?

optional allowedHosts: string[]

List of allowed hosts. If set, only these hosts are allowed to call

allowedProtocols?

optional allowedProtocols: string[]

List of allowed protocols. If set, only these protocols are allowed to call

corsCheck?

optional corsCheck: boolean

Flag to enable CORS policy check

Default

ts
false

disallowedHosts?

optional disallowedHosts: string[]

List of disallowed hosts. If set, these hosts are not allowed to call

Default

ts
['localhost', '127.0.0.1']

fs?

optional fs: IFs

The virtual file system of the sandbox (excludes node_modules)

rateLimitDuration?

optional rateLimitDuration: number

Duration in seconds for the rate limit

Default

ts
1

rateLimitPoints?

optional rateLimitPoints: number

Number of requests allowed in the specified duration

Default

ts
10

timeout?

optional timeout: number

Timeout for fetch requests in milliseconds

Default

ts
5000