# withStaticFiles

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

Enables static file serving in the YARP resource.

## Definition

```typescript
interface YarpResource {
  // ... omitted for brevity
  withStaticFiles(sourcePath?: string): YarpResource
}
```

## Parameters

- `sourcePath` (`string`) `optional`

## Returns

[YarpResource](/reference/api/typescript/aspire.hosting.yarp/yarpresource.md) `builder`

## Applies to

- [YarpResource](/reference/api/typescript/aspire.hosting.yarp/yarpresource.md)
