StaticRoute is a route that will map from an incoming path to the files/directories specified by [localPath].

interface StaticRoute {
    apiKeyRequired?: boolean;
    authorizers?: Authorizer | Authorizer[];
    contentType?: string;
    iamAuthEnabled?: boolean;
    index?: string | boolean;
    localPath: string;
    path: string;
    requestValidator?: RequestValidator;
    requiredParameters?: Parameter[];
}

Hierarchy (view full)

Properties

apiKeyRequired?: boolean

If true, an API key will be required for this route. The source for the API Key can be set at the API level and by default, the source will be the HEADER.

authorizers?: Authorizer | Authorizer[]

Authorizers allows you to define Lambda authorizers be applied for authorization when the the route is called.

contentType?: string

The content-type to serve the file as. Only valid when localPath points to a file. If localPath points to a directory, the content types for all files will be inferred.

iamAuthEnabled?: boolean

By default, the route method auth type is set to NONE. If true, the auth type will be set to AWS_IAM.

index?: string | boolean

By default API.static will also serve 'index.html' in response to a request on a directory. To disable this set false or to supply a new index pass an appropriate name.

localPath: string

The local path on disk to create static S3 resources for. Files will be uploaded into S3 objects, and directories will be recursively walked into.

path: string

The path on the API that will map to files in [localPath]. If not prefixed with /, then a / will be added automatically to the beginning.

requestValidator?: RequestValidator

Request Validator specifies the validator to use at the method level. This will override anything defined at the API level.

requiredParameters?: Parameter[]

Required Parameters to validate. If the request validator is set to ALL or PARAMS_ONLY, api gateway will validate these before sending traffic to the event handler.

Generated using TypeDoc