Skip to content
Docs Try Aspire

Aspire.Hosting.Yarp

Official
📦 Aspire.Hosting.Yarp v13.2.0-preview.1.26159.1
27 Functions
7 Types

Types

Functions

function addYarp builder
Adds a YARP container to the application model.
addYarp(name: string): YarpResource
function publishWithStaticFiles builder
In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
publishWithStaticFiles(resourceWithFiles: IResourceWithContainerFiles): YarpResource
function withConfiguration builder
Configure the YARP resource.
withConfiguration(configurationBuilder: (obj: IYarpConfigurationBuilder) => void): YarpResource
function withHostHttpsPort builder
Configures the host HTTPS port that the YARP resource is exposed on instead of using randomly assigned port.
withHostHttpsPort(port: number): YarpResource
function withHostPort builder
Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
withHostPort(port: number): YarpResource
function withStaticFiles builder
Enables static file serving in the YARP resource. Static files are served from the wwwroot folder.
withStaticFiles(): YarpResource
function withTransformClientCertHeader
Adds the transform which will set the given header with the Base64 encoded client certificate.
withTransformClientCertHeader(headerName: string): YarpRoute
function withTransformCopyRequestHeaders
Adds the transform which will enable or suppress copying request headers to the proxy request.
withTransformCopyRequestHeaders(copy?: boolean): YarpRoute
function withTransformCopyResponseHeaders
Adds the transform which will enable or suppress copying response headers to the client response.
withTransformCopyResponseHeaders(copy?: boolean): YarpRoute
function withTransformCopyResponseTrailers
Adds the transform which will enable or suppress copying response trailers to the client response.
withTransformCopyResponseTrailers(copy?: boolean): YarpRoute
function withTransformForwarded
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
function withTransformHttpMethodChange
Adds the transform that will replace the HTTP method if it matches.
withTransformHttpMethodChange(fromHttpMethod: string, toHttpMethod: string): YarpRoute
function withTransformQueryRemoveKey
Adds the transform that will remove the given query key.
withTransformQueryRemoveKey(queryKey: string): YarpRoute
function withTransformQueryRouteValue
Adds the transform that will append or set the query parameter from a route value.
withTransformQueryRouteValue(queryKey: string, routeValueKey: string, append?: boolean): YarpRoute
function withTransformQueryValue
Adds the transform that will append or set the query parameter from the given value.
withTransformQueryValue(queryKey: string, value: string, append?: boolean): YarpRoute
function withTransformRequestHeader
Adds the transform which will append or set the request header.
withTransformRequestHeader(headerName: string, value: string, append?: boolean): YarpRoute
function withTransformRequestHeaderRemove
Adds the transform which will remove the request header.
withTransformRequestHeaderRemove(headerName: string): YarpRoute
function withTransformRequestHeaderRouteValue
Adds the transform which will append or set the request header from a route value.
withTransformRequestHeaderRouteValue(headerName: string, routeValueKey: string, append?: boolean): YarpRoute
function withTransformRequestHeadersAllowed
Adds the transform which will only copy the allowed request headers. Other transforms
withTransformRequestHeadersAllowed(allowedHeaders: string[]): YarpRoute
function withTransformResponseHeader
Adds the transform which will append or set the response header.
withTransformResponseHeader(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute
function withTransformResponseHeaderRemove
Adds the transform which will remove the response header.
withTransformResponseHeaderRemove(headerName: string, condition?: ResponseCondition): YarpRoute
function withTransformResponseHeadersAllowed
Adds the transform which will only copy the allowed response headers. Other transforms
withTransformResponseHeadersAllowed(allowedHeaders: string[]): YarpRoute
function withTransformResponseTrailer
Adds the transform which will append or set the response trailer.
withTransformResponseTrailer(headerName: string, value: string, append?: boolean, condition?: ResponseCondition): YarpRoute
function withTransformResponseTrailerRemove
Adds the transform which will remove the response trailer.
withTransformResponseTrailerRemove(headerName: string, condition?: ResponseCondition): YarpRoute
function withTransformResponseTrailersAllowed
Adds the transform which will only copy the allowed response trailers. Other transforms
withTransformResponseTrailersAllowed(allowedHeaders: string[]): YarpRoute
function withTransformUseOriginalHostHeader
Adds the transform which will copy the incoming request Host header to the proxy request.
withTransformUseOriginalHostHeader(useOriginal?: boolean): YarpRoute
function withTransformXForwarded
Adds the transform which will add X-Forwarded-* headers.
withTransformXForwarded(headerPrefix?: string, xDefault?: ForwardedTransformActions, xFor?: ForwardedTransformActions, xHost?: ForwardedTransformActions, xProto?: ForwardedTransformActions, xPrefix?: ForwardedTransformActions): YarpRoute

Enums