YarpResourceExtensions
Class static net10.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)extensionIResourceBuilder<YarpResource> Adds a YARP container to the application model.
PublishWithStaticFiles(IResourceBuilder<YarpResource>, IResourceBuilder<IResourceWithContainerFiles>)extensionIResourceBuilder<YarpResource> In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
WithConfiguration(IResourceBuilder<YarpResource>, Action<IYarpConfigurationBuilder>)extensionIResourceBuilder<YarpResource> Configure the YARP resource.
WithHostHttpsPort(IResourceBuilder<YarpResource>, int?)extensionIResourceBuilder<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?)extensionIResourceBuilder<YarpResource> Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
WithStaticFiles(IResourceBuilder<YarpResource>)extensionIResourceBuilder<YarpResource> Enables static file serving in the YARP resource. Static files are served from the wwwroot folder.
WithStaticFiles(IResourceBuilder<YarpResource>, string)extensionIResourceBuilder<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.