Watch Aspire live streamsDocsTry Aspire

Aspire.Hosting.Yarp

Official
📦 Aspire.Hosting.Yarpv13.6.0
55Functions
16Types

Types

Functions

methodaddCatchAllRoute
Adds a catch-all route for a cluster, endpoint, resource, or string destination target.
addCatchAllRoute(target: YarpCluster | EndpointReference | IResourceWithServiceDiscovery | ExternalServiceResource | string): YarpRoute
methodaddClusterFromEndpoint
Adds a cluster for an endpoint reference.
addClusterFromEndpoint(endpoint: EndpointReference): YarpCluster
methodaddClusterFromExternalService
Adds a cluster for an external service resource.
addClusterFromExternalService(externalService: ExternalServiceResource): YarpCluster
methodaddClusterFromResource
Adds a cluster for a resource that supports service discovery.
addClusterFromResource(resource: IResourceWithServiceDiscovery): YarpCluster
methodaddClusterWithDestination
Adds a cluster from a single destination.
addClusterWithDestination(clusterName: string, destination: any): YarpCluster
methodaddClusterWithDestinations
Adds a cluster from multiple destinations.
addClusterWithDestinations(clusterName: string, destinations: any[]): YarpCluster
methodaddRoute
Adds a route for a cluster, endpoint, resource, or string destination target.
addRoute(path: string, target: YarpCluster | EndpointReference | IResourceWithServiceDiscovery | ExternalServiceResource | string): YarpRoute
methodaddYarpbuilder
Adds a YARP container to the application model.
addYarp(name: string): YarpResource
methodpublishWithStaticFilesbuilder
In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
publishWithStaticFiles(resourceWithFiles: IResourceWithContainerFiles): YarpResource
methodwithConfigurationbuilder
Configure the YARP resource.
withConfiguration(configurationBuilder: (obj: IYarpConfigurationBuilder) => Promise<void>): YarpResource
methodwithForwarderRequestConfig
Set the forwarder request configuration for the cluster.
withForwarderRequestConfig(config: YarpForwarderRequestConfig): YarpCluster
methodwithHealthCheckConfig
Set the health check configuration for the cluster.
withHealthCheckConfig(config: YarpHealthCheckConfig): YarpCluster
methodwithHostHttpsPortbuilder
Configures 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): YarpResource
methodwithHostPortbuilder
Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): YarpResource
methodwithHttpClientConfig
Set the HTTP client configuration for the cluster.
withHttpClientConfig(config: YarpHttpClientConfig): YarpCluster
methodwithLoadBalancingPolicy
Set the LoadBalancingPolicy for the cluster.
withLoadBalancingPolicy(policy: string): YarpCluster
methodwithMatch
Set the parameters used to match requests.
withMatch(match: YarpRouteMatch): YarpRoute
methodwithMatchHeaders
Only match requests that contain all of these headers.
withMatchHeaders(headers: YarpRouteHeaderMatch[]): YarpRoute
methodwithMatchHosts
Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
withMatchHosts(hosts: string[]): YarpRoute
methodwithMatchMethods
Only match requests that use these optional HTTP methods. E.g. GET, POST.
withMatchMethods(methods: string[]): YarpRoute
methodwithMatchPath
Only match requests with the given Path pattern.
withMatchPath(path: string): YarpRoute
methodwithMatchRouteQueryParameter
Only match requests that contain all of these query parameters.
withMatchRouteQueryParameter(queryParameters: YarpRouteQueryParameterMatch[]): YarpRoute
methodwithMaxRequestBodySize
Set the MaxRequestBodySize for the destination
withMaxRequestBodySize(maxRequestBodySize: number): YarpRoute
methodwithMetadata
Set the Metadata for the cluster.
withMetadata(metadata: Dict<string,string>): YarpCluster
methodwithMetadata
Set the Metadata of the destination
withMetadata(metadata: Dict<string,string>): YarpRoute
methodwithOrder
Set the order for the destination
withOrder(order: number): YarpRoute
methodwithSessionAffinityConfig
Set the session affinity configuration for the cluster.
withSessionAffinityConfig(config: YarpSessionAffinityConfig): YarpCluster
methodwithStaticFilesbuilder
Enables static file serving in the YARP resource.
withStaticFiles(sourcePath?: string): YarpResource
methodwithTransform
Add a new transform to the destination.
withTransform(transform: Dict<string,string>): YarpRoute
methodwithTransformClientCertHeader
Adds the transform which will set the given header with the Base64 encoded client certificate.
withTransformClientCertHeader(headerName: string): YarpRoute
methodwithTransformCopyRequestHeaders
Adds the transform which will enable or suppress copying request headers to the proxy request.
withTransformCopyRequestHeaders(copy?: boolean): YarpRoute
methodwithTransformCopyResponseHeaders
Adds the transform which will enable or suppress copying response headers to the client response.
withTransformCopyResponseHeaders(copy?: boolean): YarpRoute
methodwithTransformCopyResponseTrailers
Adds the transform which will enable or suppress copying response trailers to the client response.
withTransformCopyResponseTrailers(copy?: boolean): YarpRoute
methodwithTransformForwarded
Adds 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): YarpRoute
methodwithTransformHttpMethodChange
Adds the transform that will replace the HTTP method if it matches.
withTransformHttpMethodChange(fromHttpMethod: string, toHttpMethod: string): YarpRoute
methodwithTransformPathPrefix
Adds the transform which will prefix the request path with the given value.
withTransformPathPrefix(prefix: string): YarpRoute
methodwithTransformPathRemovePrefix
Adds the transform which will remove the matching prefix from the request path.
withTransformPathRemovePrefix(prefix: string): YarpRoute
methodwithTransformPathRouteValues
Adds the transform which will set the request path with route values.
withTransformPathRouteValues(pattern: string): YarpRoute
methodwithTransformPathSet
Adds the transform which sets the request path with the given value.
withTransformPathSet(path: string): YarpRoute
methodwithTransformQueryRemoveKey
Adds the transform that will remove the given query key.
withTransformQueryRemoveKey(queryKey: string): YarpRoute
methodwithTransformQueryRouteValue
Adds the transform that will append or set the query parameter from a route value.
withTransformQueryRouteValue(queryKey: string, routeValueKey: string, append?: boolean): YarpRoute
methodwithTransformQueryValue
Adds the transform that will append or set the query parameter from the given value.
withTransformQueryValue(queryKey: string, value: string, append?: boolean): YarpRoute
methodwithTransformRequestHeader
Adds the transform which will append or set the request header.
withTransformRequestHeader(headerName: string, value: string, append?: boolean): YarpRoute
methodwithTransformRequestHeaderRemove
Adds the transform which will remove the request header.
withTransformRequestHeaderRemove(headerName: string): YarpRoute
methodwithTransformRequestHeaderRouteValue
Adds the transform which will append or set the request header from a route value.
withTransformRequestHeaderRouteValue(headerName: string, routeValueKey: string, append?: boolean): YarpRoute
methodwithTransformRequestHeadersAllowed
Adds 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[]): YarpRoute
methodwithTransformResponseHeader
Adds the transform which will append or set the response header.
withTransformResponseHeader(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute
methodwithTransformResponseHeaderRemove
Adds the transform which will remove the response header.
withTransformResponseHeaderRemove(headerName: string, condition?: ResponseCondition): YarpRoute
methodwithTransformResponseHeadersAllowed
Adds 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[]): YarpRoute
methodwithTransformResponseTrailer
Adds the transform which will append or set the response trailer.
withTransformResponseTrailer(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute
methodwithTransformResponseTrailerRemove
Adds the transform which will remove the response trailer.
withTransformResponseTrailerRemove(headerName: string, condition?: ResponseCondition): YarpRoute
methodwithTransformResponseTrailersAllowed
Adds 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[]): YarpRoute
methodwithTransforms
Set the Transforms of the destination
withTransforms(transforms: Dict<string,string>[]): YarpRoute
methodwithTransformUseOriginalHostHeader
Adds the transform which will copy the incoming request Host header to the proxy request.
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoute
methodwithTransformXForwarded
Adds the transform which will add X-Forwarded-* headers.
withTransformXForwarded(headerPrefix?: string, xDefault?: ForwardedTransformActions, xFor?: ForwardedTransformActions, xHost?: ForwardedTransformActions, xProto?: ForwardedTransformActions, xPrefix?: ForwardedTransformActions): YarpRoute

Enums