YarpRoute
Handle
interface YarpRoute { withMatch(match: YarpRouteMatch): YarpRoute; withMatchHeaders(headers: YarpRouteHeaderMatch[]): YarpRoute; withMatchHosts(hosts: string[]): YarpRoute; withMatchMethods(methods: string[]): YarpRoute; withMatchPath(path: string): YarpRoute; withMatchRouteQueryParameter(queryParameters: YarpRouteQueryParameterMatch[]): YarpRoute; withMaxRequestBodySize(maxRequestBodySize: number): YarpRoute; withMetadata(metadata: Dict<string,string>): YarpRoute; withOrder(order: number): YarpRoute; withTransform(transform: Dict<string,string>): YarpRoute; withTransformClientCertHeader(headerName: string): YarpRoute; withTransformCopyRequestHeaders(copy?: boolean): YarpRoute; withTransformCopyResponseHeaders(copy?: boolean): YarpRoute; withTransformCopyResponseTrailers(copy?: boolean): YarpRoute; withTransformForwarded( useHost?: boolean, useProto?: boolean, forFormat?: NodeFormat, byFormat?: NodeFormat, action?: ForwardedTransformActions): YarpRoute; withTransformHttpMethodChange( fromHttpMethod: string, toHttpMethod: string): YarpRoute; withTransformPathPrefix(prefix: string): YarpRoute; withTransformPathRemovePrefix(prefix: string): YarpRoute; withTransformPathRouteValues(pattern: string): YarpRoute; withTransformPathSet(path: string): YarpRoute; withTransformQueryRemoveKey(queryKey: string): YarpRoute; withTransformQueryRouteValue( queryKey: string, routeValueKey: string, append?: boolean): YarpRoute; withTransformQueryValue( queryKey: string, value: string, append?: boolean): YarpRoute; withTransformRequestHeader( headerName: string, value: string, append?: boolean): YarpRoute; withTransformRequestHeaderRemove(headerName: string): YarpRoute; withTransformRequestHeaderRouteValue( headerName: string, routeValueKey: string, append?: boolean): YarpRoute; withTransformRequestHeadersAllowed(allowedHeaders: string[]): YarpRoute; withTransformResponseHeader( headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute; withTransformResponseHeaderRemove( headerName: string, condition?: ResponseCondition): YarpRoute; withTransformResponseHeadersAllowed(allowedHeaders: string[]): YarpRoute; withTransformResponseTrailer( headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute; withTransformResponseTrailerRemove( headerName: string, condition?: ResponseCondition): YarpRoute; withTransformResponseTrailersAllowed(allowedHeaders: string[]): YarpRoute; withTransforms(transforms: Dict<string,string>[]): YarpRoute; withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoute; withTransformXForwarded( headerPrefix?: string, xDefault?: ForwardedTransformActions, xFor?: ForwardedTransformActions, xHost?: ForwardedTransformActions, xProto?: ForwardedTransformActions, xPrefix?: ForwardedTransformActions): YarpRoute;}36 members
Methods
method
withMatchSet the parameters used to match requests.
withMatch(match: YarpRouteMatch): YarpRouteParameters
matchYarpRouteMatchReturns
YarpRoutemethod
withMatchHeadersOnly match requests that contain all of these headers.
withMatchHeaders(headers: YarpRouteHeaderMatch[]): YarpRouteParameters
headersYarpRouteHeaderMatch[]Returns
YarpRoutemethod
withMatchHostsOnly match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
withMatchHosts(hosts: string[]): YarpRouteParameters
hostsstring[]Returns
YarpRoutemethod
withMatchMethodsOnly match requests that use these optional HTTP methods. E.g. GET, POST.
withMatchMethods(methods: string[]): YarpRouteParameters
methodsstring[]Returns
YarpRoutemethod
withMatchPathOnly match requests with the given Path pattern.
withMatchPath(path: string): YarpRouteParameters
pathstringReturns
YarpRouteOnly match requests that contain all of these query parameters.
withMatchRouteQueryParameter(queryParameters: YarpRouteQueryParameterMatch[]): YarpRouteParameters
queryParametersYarpRouteQueryParameterMatch[]Returns
YarpRoutemethod
withMaxRequestBodySizeSet the MaxRequestBodySize for the destination
withMaxRequestBodySize(maxRequestBodySize: number): YarpRouteParameters
maxRequestBodySizenumberReturns
YarpRoutemethod
withMetadataSet the Metadata of the destination
withMetadata(metadata: Dict<string,string>): YarpRouteParameters
metadataDict<string,string>Returns
YarpRoutemethod
withOrderSet the order for the destination
withOrder(order: number): YarpRouteParameters
ordernumberReturns
YarpRoutemethod
withTransformAdd a new transform to the destination.
withTransform(transform: Dict<string,string>): YarpRouteParameters
transformDict<string,string>Returns
YarpRouteAdds the transform which will set the given header with the Base64 encoded client certificate.
withTransformClientCertHeader(headerName: string): YarpRouteParameters
headerNamestringReturns
YarpRouteAdds the transform which will enable or suppress copying request headers to the proxy request.
withTransformCopyRequestHeaders(copy?: boolean): YarpRouteParameters
copybooleanoptional= TrueReturns
YarpRouteAdds the transform which will enable or suppress copying response headers to the client response.
withTransformCopyResponseHeaders(copy?: boolean): YarpRouteParameters
copybooleanoptional= TrueReturns
YarpRouteAdds the transform which will enable or suppress copying response trailers to the client response.
withTransformCopyResponseTrailers(copy?: boolean): YarpRouteParameters
copybooleanoptional= TrueReturns
YarpRoutemethod
withTransformForwardedAdds the transform which will add the Forwarded header as defined by [RFC 7239](https://tools.ietf.org/html/rfc7239).
withTransformForwarded( useHost?: boolean, useProto?: boolean, forFormat?: NodeFormat, byFormat?: NodeFormat, action?: ForwardedTransformActions): YarpRouteParameters
useHostbooleanoptional= TrueuseProtobooleanoptional= TrueforFormatNodeFormatoptional= RandombyFormatNodeFormatoptional= RandomactionForwardedTransformActionsoptional= SetReturns
YarpRouteAdds the transform that will replace the HTTP method if it matches.
withTransformHttpMethodChange( fromHttpMethod: string, toHttpMethod: string): YarpRouteParameters
fromHttpMethodstringtoHttpMethodstringReturns
YarpRoutemethod
withTransformPathPrefixAdds the transform which will prefix the request path with the given value.
withTransformPathPrefix(prefix: string): YarpRouteParameters
prefixstringReturns
YarpRouteAdds the transform which will remove the matching prefix from the request path.
withTransformPathRemovePrefix(prefix: string): YarpRouteParameters
prefixstringReturns
YarpRouteAdds the transform which will set the request path with route values.
withTransformPathRouteValues(pattern: string): YarpRouteParameters
patternstringReturns
YarpRoutemethod
withTransformPathSetAdds the transform which sets the request path with the given value.
withTransformPathSet(path: string): YarpRouteParameters
pathstringReturns
YarpRouteAdds the transform that will remove the given query key.
withTransformQueryRemoveKey(queryKey: string): YarpRouteParameters
queryKeystringReturns
YarpRouteAdds the transform that will append or set the query parameter from a route value.
withTransformQueryRouteValue( queryKey: string, routeValueKey: string, append?: boolean): YarpRouteParameters
queryKeystringrouteValueKeystringappendbooleanoptional= TrueReturns
YarpRoutemethod
withTransformQueryValueAdds the transform that will append or set the query parameter from the given value.
withTransformQueryValue( queryKey: string, value: string, append?: boolean): YarpRouteParameters
queryKeystringvaluestringappendbooleanoptional= TrueReturns
YarpRouteAdds the transform which will append or set the request header.
withTransformRequestHeader( headerName: string, value: string, append?: boolean): YarpRouteParameters
headerNamestringvaluestringappendbooleanoptional= TrueReturns
YarpRouteAdds the transform which will remove the request header.
withTransformRequestHeaderRemove(headerName: string): YarpRouteParameters
headerNamestringReturns
YarpRouteAdds the transform which will append or set the request header from a route value.
withTransformRequestHeaderRouteValue( headerName: string, routeValueKey: string, append?: boolean): YarpRouteParameters
headerNamestringrouteValueKeystringappendbooleanoptional= TrueReturns
YarpRouteAdds the transform which will only copy the allowed request headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
withTransformRequestHeadersAllowed(allowedHeaders: string[]): YarpRouteParameters
allowedHeadersstring[]Returns
YarpRouteAdds the transform which will append or set the response header.
withTransformResponseHeader( headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRouteParameters
headerNamestringvaluestringappendbooleanoptional= TrueconditionResponseConditionoptional= SuccessReturns
YarpRouteAdds the transform which will remove the response header.
withTransformResponseHeaderRemove( headerName: string, condition?: ResponseCondition): YarpRouteParameters
headerNamestringconditionResponseConditionoptional= SuccessReturns
YarpRouteAdds the transform which will only copy the allowed response headers. Other transforms that modify or append to existing headers may be affected if not included in the allow list.
withTransformResponseHeadersAllowed(allowedHeaders: string[]): YarpRouteParameters
allowedHeadersstring[]Returns
YarpRouteAdds the transform which will append or set the response trailer.
withTransformResponseTrailer( headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRouteParameters
headerNamestringvaluestringappendbooleanoptional= TrueconditionResponseConditionoptional= SuccessReturns
YarpRouteAdds the transform which will remove the response trailer.
withTransformResponseTrailerRemove( headerName: string, condition?: ResponseCondition): YarpRouteParameters
headerNamestringconditionResponseConditionoptional= SuccessReturns
YarpRouteAdds the transform which will only copy the allowed response trailers. Other transforms that modify or append to existing trailers may be affected if not included in the allow list.
withTransformResponseTrailersAllowed(allowedHeaders: string[]): YarpRouteParameters
allowedHeadersstring[]Returns
YarpRoutemethod
withTransformsSet the Transforms of the destination
withTransforms(transforms: Dict<string,string>[]): YarpRouteParameters
transformsDict<string,string>[]Returns
YarpRouteAdds the transform which will copy the incoming request Host header to the proxy request.
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRouteParameters
useOriginalbooleanoptional= TrueReturns
YarpRoutemethod
withTransformXForwardedAdds the transform which will add X-Forwarded-* headers.
withTransformXForwarded( headerPrefix?: string, xDefault?: ForwardedTransformActions, xFor?: ForwardedTransformActions, xHost?: ForwardedTransformActions, xProto?: ForwardedTransformActions, xPrefix?: ForwardedTransformActions): YarpRouteParameters
headerPrefixstringoptional= X-Forwarded-xDefaultForwardedTransformActionsoptional= SetxForForwardedTransformActionsoptionalxHostForwardedTransformActionsoptionalxProtoForwardedTransformActionsoptionalxPrefixForwardedTransformActionsoptionalReturns
YarpRoute