Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface RouteCriteria

Criteria for matching a request.

Hierarchy

  • RouteCriteria

Index

Properties

Optional cookies

cookies: undefined | {}

Matches a request based on one or more cookie values. Keys are case-sensitive cookie names, values are regular expressions to match or null. When value is null then requests are matched for the cookie not being present.

Optional headers

headers: undefined | {}

Matches a request based on one or more header values. Keys are case-insensitive header names, values are regular expressions to match or null. When value is null then requests are matched for the header not being present.

Optional method

method: string | RegExp

Matches a request based on the HTTP method. Instead of this, prefer using get, post, put, delete, options, and patch methods.

Optional path

path: undefined | string

Matches a request based on the path. The same path syntax is used by the simple form of the Router class's match method.

Optional protocol

protocol: string | RegExp

Matches a request based on its protocol. Unless explicitly specified then https is the default. To serve a route on both HTTPS and HTTP you can specify /https?/ regex. If an HTTP request is not matched against any route, Layer0 will automatically issue a redirect to equivalent HTTPS URL.

Optional query

query: undefined | {}

Matches a request based on one or more query parameter values. Keys are case-sensitive names, values are regular expressions to match or null. When value is null then requests are matched for the query parameter not being present.

Optional response

Matches a request response. This is used by error pages to make edge aware of a matching error route. This will issue a restart on a edge with specific header that matches the error route on next eval.

Generated using TypeDoc