Aspire.Hosting.Yarp
Official
📦 Aspire.Hosting.Yarpv13.6.055Functions
16Types
16 types and 0 members
Types
interface
IYarpConfigurationBuilder7 memberstype
YarpActiveHealthCheckConfig6 fieldshandle
YarpCluster6 memberstype
YarpForwarderRequestConfig4 fieldstype
YarpHealthCheckConfig3 fieldstype
YarpHttpClientConfig7 fieldstype
YarpPassiveHealthCheckConfig3 fieldshandle
YarpResource5 membershandle
YarpRoute36 memberstype
YarpRouteHeaderMatch4 fieldstype
YarpRouteMatch5 fieldstype
YarpRouteQueryParameterMatch4 fieldstype
YarpSessionAffinityConfig5 fieldstype
YarpSessionAffinityCookieConfig8 fieldstype
YarpWebProxyConfig3 fieldsFunctions
method
addCatchAllRouteAdds a catch-all route for a cluster, endpoint, resource, or string destination target.
addCatchAllRoute(target: YarpCluster | EndpointReference | IResourceWithServiceDiscovery | ExternalServiceResource | string): YarpRoutemethod
addClusterFromEndpointAdds a cluster for an endpoint reference.
addClusterFromEndpoint(endpoint: EndpointReference): YarpClustermethod
addClusterFromExternalServiceAdds a cluster for an external service resource.
addClusterFromExternalService(externalService: ExternalServiceResource): YarpClustermethod
addClusterFromResourceAdds a cluster for a resource that supports service discovery.
addClusterFromResource(resource: IResourceWithServiceDiscovery): YarpClustermethod
addClusterWithDestinationAdds a cluster from a single destination.
addClusterWithDestination(clusterName: string, destination: any): YarpClustermethod
addClusterWithDestinationsAdds a cluster from multiple destinations.
addClusterWithDestinations(clusterName: string, destinations: any[]): YarpClustermethod
addRouteAdds a route for a cluster, endpoint, resource, or string destination target.
addRoute(path: string, target: YarpCluster | EndpointReference | IResourceWithServiceDiscovery | ExternalServiceResource | string): YarpRoutemethod
addYarpbuilderAdds a YARP container to the application model.
addYarp(name: string): YarpResourcemethod
publishWithStaticFilesbuilderIn publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
publishWithStaticFiles(resourceWithFiles: IResourceWithContainerFiles): YarpResourcemethod
withConfigurationbuilderConfigure the YARP resource.
withConfiguration(configurationBuilder: (obj: IYarpConfigurationBuilder) => Promise<void>): YarpResourcemethod
withForwarderRequestConfigSet the forwarder request configuration for the cluster.
withForwarderRequestConfig(config: YarpForwarderRequestConfig): YarpClustermethod
withHealthCheckConfigSet the health check configuration for the cluster.
withHealthCheckConfig(config: YarpHealthCheckConfig): YarpClustermethod
withHostHttpsPortbuilderConfigures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port. This will only have effect if an HTTPS endpoint is configured on the YARP resource due to TLS termination being enabled.
withHostHttpsPort(port: number): YarpResourcemethod
withHostPortbuilderConfigures the host port that the YARP resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): YarpResourcemethod
withHttpClientConfigSet the HTTP client configuration for the cluster.
withHttpClientConfig(config: YarpHttpClientConfig): YarpClustermethod
withLoadBalancingPolicySet the LoadBalancingPolicy for the cluster.
withLoadBalancingPolicy(policy: string): YarpClustermethod
withMatchSet the parameters used to match requests.
withMatch(match: YarpRouteMatch): YarpRoutemethod
withMatchHeadersOnly match requests that contain all of these headers.
withMatchHeaders(headers: YarpRouteHeaderMatch[]): YarpRoutemethod
withMatchHostsOnly match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
withMatchHosts(hosts: string[]): YarpRoutemethod
withMatchMethodsOnly match requests that use these optional HTTP methods. E.g. GET, POST.
withMatchMethods(methods: string[]): YarpRoutemethod
withMatchPathOnly match requests with the given Path pattern.
withMatchPath(path: string): YarpRoutemethod
withMatchRouteQueryParameterOnly match requests that contain all of these query parameters.
withMatchRouteQueryParameter(queryParameters: YarpRouteQueryParameterMatch[]): YarpRoutemethod
withMaxRequestBodySizeSet the MaxRequestBodySize for the destination
withMaxRequestBodySize(maxRequestBodySize: number): YarpRoutemethod
withMetadataSet the Metadata for the cluster.
withMetadata(metadata: Dict<string,string>): YarpClustermethod
withMetadataSet the Metadata of the destination
withMetadata(metadata: Dict<string,string>): YarpRoutemethod
withOrderSet the order for the destination
withOrder(order: number): YarpRoutemethod
withSessionAffinityConfigSet the session affinity configuration for the cluster.
withSessionAffinityConfig(config: YarpSessionAffinityConfig): YarpClustermethod
withStaticFilesbuilderEnables static file serving in the YARP resource.
withStaticFiles(sourcePath?: string): YarpResourcemethod
withTransformAdd a new transform to the destination.
withTransform(transform: Dict<string,string>): YarpRoutemethod
withTransformClientCertHeaderAdds the transform which will set the given header with the Base64 encoded client certificate.
withTransformClientCertHeader(headerName: string): YarpRoutemethod
withTransformCopyRequestHeadersAdds the transform which will enable or suppress copying request headers to the proxy request.
withTransformCopyRequestHeaders(copy?: boolean): YarpRoutemethod
withTransformCopyResponseHeadersAdds the transform which will enable or suppress copying response headers to the client response.
withTransformCopyResponseHeaders(copy?: boolean): YarpRoutemethod
withTransformCopyResponseTrailersAdds the transform which will enable or suppress copying response trailers to the client response.
withTransformCopyResponseTrailers(copy?: boolean): 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): YarpRoutemethod
withTransformHttpMethodChangeAdds the transform that will replace the HTTP method if it matches.
withTransformHttpMethodChange(fromHttpMethod: string, toHttpMethod: string): YarpRoutemethod
withTransformPathPrefixAdds the transform which will prefix the request path with the given value.
withTransformPathPrefix(prefix: string): YarpRoutemethod
withTransformPathRemovePrefixAdds the transform which will remove the matching prefix from the request path.
withTransformPathRemovePrefix(prefix: string): YarpRoutemethod
withTransformPathRouteValuesAdds the transform which will set the request path with route values.
withTransformPathRouteValues(pattern: string): YarpRoutemethod
withTransformPathSetAdds the transform which sets the request path with the given value.
withTransformPathSet(path: string): YarpRoutemethod
withTransformQueryRemoveKeyAdds the transform that will remove the given query key.
withTransformQueryRemoveKey(queryKey: string): YarpRoutemethod
withTransformQueryRouteValueAdds the transform that will append or set the query parameter from a route value.
withTransformQueryRouteValue(queryKey: string, routeValueKey: string, append?: boolean): YarpRoutemethod
withTransformQueryValueAdds the transform that will append or set the query parameter from the given value.
withTransformQueryValue(queryKey: string, value: string, append?: boolean): YarpRoutemethod
withTransformRequestHeaderAdds the transform which will append or set the request header.
withTransformRequestHeader(headerName: string, value: string, append?: boolean): YarpRoutemethod
withTransformRequestHeaderRemoveAdds the transform which will remove the request header.
withTransformRequestHeaderRemove(headerName: string): YarpRoutemethod
withTransformRequestHeaderRouteValueAdds the transform which will append or set the request header from a route value.
withTransformRequestHeaderRouteValue(headerName: string, routeValueKey: string, append?: boolean): YarpRoutemethod
withTransformRequestHeadersAllowedAdds 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[]): YarpRoutemethod
withTransformResponseHeaderAdds the transform which will append or set the response header.
withTransformResponseHeader(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoutemethod
withTransformResponseHeaderRemoveAdds the transform which will remove the response header.
withTransformResponseHeaderRemove(headerName: string, condition?: ResponseCondition): YarpRoutemethod
withTransformResponseHeadersAllowedAdds 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[]): YarpRoutemethod
withTransformResponseTrailerAdds the transform which will append or set the response trailer.
withTransformResponseTrailer(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoutemethod
withTransformResponseTrailerRemoveAdds the transform which will remove the response trailer.
withTransformResponseTrailerRemove(headerName: string, condition?: ResponseCondition): YarpRoutemethod
withTransformResponseTrailersAllowedAdds 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[]): YarpRoutemethod
withTransformsSet the Transforms of the destination
withTransforms(transforms: Dict<string,string>[]): YarpRoutemethod
withTransformUseOriginalHostHeaderAdds the transform which will copy the incoming request Host header to the proxy request.
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoutemethod
withTransformXForwardedAdds the transform which will add X-Forwarded-* headers.
withTransformXForwarded(headerPrefix?: string, xDefault?: ForwardedTransformActions, xFor?: ForwardedTransformActions, xHost?: ForwardedTransformActions, xProto?: ForwardedTransformActions, xPrefix?: ForwardedTransformActions): YarpRoute