API โ€บ @builder.io/qwik-city/vite/vercel/serverless

FUNCTION_DIRECTORY

FUNCTION_DIRECTORY = "_qwik-city-serverless";

Edit this section

ServerlessFunctionConfig

export interface ServerlessFunctionConfig

Property

Modifiers

Type

Description

environment?

Record<string, string>[]

(Optional) Map of additional environment variables that will be available to the Serverless Function, in addition to the env vars specified in the Project Settings.

Required: No

handler

string

Indicates the initial file where code will be executed for the Serverless Function.

Required: Yes

maxDuration?

number

(Optional) Maximum duration (in seconds) that will be allowed for the Serverless Function.

Required: No

memory?

number

(Optional) Amount of memory (RAM in MB) that will be allocated to the Serverless Function.

Required: No

regions?

string[]

(Optional) List of Vercel Regions where the Serverless Function will be deployed to.

Required: No

runtime

string

Specifies which "runtime" will be used to execute the Serverless Function.

Required: Yes

supportsResponseStreaming?

boolean

(Optional) When true, the Serverless Function will stream the response to the client.

Required: No

supportsWrapper?

boolean

(Optional) True if a custom runtime has support for Lambda runtime wrappers.

Required: No

Edit this section

vercelServerlessAdapter

export declare function vercelServerlessAdapter(
  opts?: VercelServerlessAdapterOptions,
): any;

Parameter

Type

Description

opts

VercelServerlessAdapterOptions

(Optional)

any

Edit this section

VercelServerlessAdapterOptions

export interface VercelServerlessAdapterOptions extends ServerAdapterOptions

Extends: ServerAdapterOptions

Property

Modifiers

Type

Description

awsLambdaHandler?

string

(Optional) AWS Handler Value for when the serverless function uses AWS Lambda syntax.

Required: No

environment?

{ [key: string]: string; }

(Optional) Specifies environment variables for the serverless function.

Required: No

maxDuration?

number

(Optional) Specifies the maximum duration that the serverless function can run.

Required: No

memory?

number

(Optional) Specifies the memory allocation for the serverless function.

Required: No

outputConfig?

boolean

(Optional) Determines if the build should auto-generate the .vercel/output/config.json config.

Defaults to true.

regions?

string[]

(Optional) Specifies the regions in which the serverless function should run.

Required: No

runtime?

string

(Optional) Specifies the runtime environment for the function, for example, Node.js, Deno, etc.

Required: No

shouldAddHelpers?

boolean

(Optional) Enables request and response helpers methods.

Required: No Default: false

shouldAddSourceMapSupport?

boolean

(Optional) Enables source map generation.

Required: No Default: false

staticPaths?

string[]

(Optional) Manually add pathnames that should be treated as static paths and not SSR. For example, when these pathnames are requested, their response should come from a static file, rather than a server-side rendered response.

target?

string

(Optional) Specifies the target platform for the deployment, such as Vercel, AWS, etc.

Required: No

vcConfigEntryPoint?

string

(Optional) The entrypoint property in the .vc-config.json file. Indicates the initial file where code will be executed for the Edge Function.

Defaults to entry.vercel-edge.js.

Edit this section