# YarpResource

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

## Definition

```typescript
interface YarpResource
  extends IComputeResource,
    IContainerFilesDestinationResource,
    IResource,
    IResourceWithArgs,
    IResourceWithEndpoints,
    IResourceWithEnvironment,
    IResourceWithProbes,
    IResourceWithWaitSupport,
    IResourceWithServiceDiscovery {
  publishWithStaticFiles(resourceWithFiles: IResourceWithContainerFiles): YarpResource;
  withConfiguration(configurationBuilder: (obj: IYarpConfigurationBuilder) => Promise<void>): YarpResource;
  withHostHttpsPort(port: number): YarpResource;
  withHostPort(port: number): YarpResource;
  withStaticFiles(sourcePath?: string): YarpResource;
}
```

## Methods

- [publishWithStaticFiles](/reference/api/typescript/aspire.hosting.yarp/yarpresource/publishwithstaticfiles.md) -- `method` -- In publish mode, generates a Dockerfile that copies static files from the specified resource into /app/wwwroot.
    ```typescript
  publishWithStaticFiles(resourceWithFiles: IResourceWithContainerFiles): YarpResource
  ```
- [withConfiguration](/reference/api/typescript/aspire.hosting.yarp/yarpresource/withconfiguration.md) -- `method` -- Configure the YARP resource.
    ```typescript
  withConfiguration(configurationBuilder: (obj: IYarpConfigurationBuilder) => Promise<void>): YarpResource
  ```
- [withHostHttpsPort](/reference/api/typescript/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.
    ```typescript
  withHostHttpsPort(port: number): YarpResource
  ```
- [withHostPort](/reference/api/typescript/aspire.hosting.yarp/yarpresource/withhostport.md) -- `method` -- Configures the host port that the YARP resource is exposed on instead of using randomly assigned port.
    ```typescript
  withHostPort(port: number): YarpResource
  ```
- [withStaticFiles](/reference/api/typescript/aspire.hosting.yarp/yarpresource/withstaticfiles.md) -- `method` -- Enables static file serving in the YARP resource.
    ```typescript
  withStaticFiles(sourcePath?: string): YarpResource
  ```
