# YarpResource

- Module: [Aspire.Hosting.Yarp](/reference/api/typescript/aspire.hosting.yarp.md)
- Version: `13.2.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(): 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.
    ```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. Static files are served from the wwwroot folder.
    ```typescript
  withStaticFiles(): YarpResource
  ```
