Aspirerelease/17.0
Watch Aspire live streamsDocsTry Aspire

YarpResource

Handle
📦 Aspire.Hosting.Yarp v17.0.0
type YarpResource interface {
IComputeResource
IContainerFilesDestinationResource
Resource
ResourceWithArgs
ResourceWithEndpoints
ResourceWithEnvironment
ResourceWithServiceDiscovery
ResourceWithWaitSupport
}

Methods

In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
PublishWithStaticFiles(resourceWithFiles ResourceWithContainerFiles) YarpResource
resourceWithFilesResourceWithContainerFilesThe resource with container files.
YarpResource

The updated resource builder.

Returns a handle; failures surface later via Err().

methodWithConfigurationbuilder
Configure the YARP resource.
WithConfiguration(configurationBuilder func(obj YarpConfigurationBuilder)) YarpResource
configurationBuilderfunc(obj YarpConfigurationBuilder)callbackThe delegate to configure YARP.
YarpResource

Returns a handle; failures surface later via Err().

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 *float64) YarpResource
port*float64The port to bind on the host. If null is used random port will be assigned.
YarpResource

The updated resource builder.

Returns a handle; failures surface later via Err().

methodWithHostPortbuilder
Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
WithHostPort(port *float64) YarpResource
port*float64The port to bind on the host. If null is used random port will be assigned.
YarpResource

Returns a handle; failures surface later via Err().

methodWithStaticFilesbuilder
Enables static file serving in the YARP resource.
WithStaticFiles(options ...*WithStaticFilesOptions) YarpResource
options...*WithStaticFilesOptionsOptional settings, described under Options.

Optional parameters are passed in a trailing options ...*WithStaticFilesOptions argument.

SourcePath*string
YarpResource

Returns a handle; failures surface later via Err().