# YarpResource

- Module: [Aspire.Hosting.Yarp](/reference/api/go/aspire.hosting.yarp.md)
- Version: `17.0.0`
- Kind: `handle`
- Source: [GitHub](https://github.com/microsoft/aspire/tree/2d325b13709752ba6d9a943635c5e2940a2530c0)

## Definition

```go
type YarpResource interface {
    IComputeResource
    IContainerFilesDestinationResource
    Resource
    ResourceWithArgs
    ResourceWithEndpoints
    ResourceWithEnvironment
    ResourceWithServiceDiscovery
    ResourceWithWaitSupport
}
```

## Embeds

- `IComputeResource`
- `IContainerFilesDestinationResource`
- `Resource`
- `ResourceWithArgs`
- `ResourceWithEndpoints`
- `ResourceWithEnvironment`
- [`ResourceWithServiceDiscovery`](/reference/api/go/aspire.hosting.yarp/resourcewithservicediscovery.md)
- `ResourceWithWaitSupport`

## Methods

- [PublishWithStaticFiles](/reference/api/go/aspire.hosting.yarp/yarpresource/publishwithstaticfiles.md) -- `method` -- In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
  ```go
  PublishWithStaticFiles(resourceWithFiles ResourceWithContainerFiles) YarpResource
  ```
- [WithConfiguration](/reference/api/go/aspire.hosting.yarp/yarpresource/withconfiguration.md) -- `method` -- Configure the YARP resource.
  ```go
  WithConfiguration(configurationBuilder func(obj YarpConfigurationBuilder)) YarpResource
  ```
- [WithHostHttpsPort](/reference/api/go/aspire.hosting.yarp/yarpresource/withhosthttpsport.md) -- `method` -- 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.
  ```go
  WithHostHttpsPort(port *float64) YarpResource
  ```
- [WithHostPort](/reference/api/go/aspire.hosting.yarp/yarpresource/withhostport.md) -- `method` -- Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
  ```go
  WithHostPort(port *float64) YarpResource
  ```
- [WithStaticFiles](/reference/api/go/aspire.hosting.yarp/yarpresource/withstaticfiles.md) -- `method` -- Enables static file serving in the YARP resource.
  ```go
  WithStaticFiles(options ...*WithStaticFilesOptions) YarpResource
  ```
