YarpResourceExtensions
Class static net8.0
Provides extension methods for adding YARP resources to the application model.
namespace Aspire.Hosting;
public static class YarpResourceExtensions{ // ...} 7 members
Methods7
Section titled MethodsAddYarp(IDistributedApplicationBuilder, string)extensionats exportIResourceBuilder<YarpResource> Adds a YARP container to the application model.
PublishWithStaticFiles(IResourceBuilder<YarpResource>, IResourceBuilder<IResourceWithContainerFiles>)extensionats exportIResourceBuilder<YarpResource> In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
WithConfiguration(IResourceBuilder<YarpResource>, Action<IYarpConfigurationBuilder>)extensionats exportIResourceBuilder<YarpResource> Configure the YARP resource.
WithHostHttpsPort(IResourceBuilder<YarpResource>, int?)extensionats exportIResourceBuilder<YarpResource> 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.
WithHostPort(IResourceBuilder<YarpResource>, int?)extensionats exportIResourceBuilder<YarpResource> Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
WithStaticFiles(IResourceBuilder<YarpResource>)extensionats exportIResourceBuilder<YarpResource> Enables static file serving in the YARP resource. Static files are served from the wwwroot folder.
WithStaticFiles(IResourceBuilder<YarpResource>, string)extensionats exportIResourceBuilder<YarpResource> Enables static file serving. In run mode: bind mounts
sourcePath to /wwwroot. In publish mode: generates a Dockerfile whose build context is sourcePath and copies its contents into /app/wwwroot baked into the image.