# YarpResource.withStaticFiles

- Module: [Aspire.Hosting.Yarp](/reference/api/typescript/aspire.hosting.yarp.md)
- Defined on: [YarpResource](/reference/api/typescript/aspire.hosting.yarp/yarpresource.md)
- Version: `13.4.0`
- Kind: `method`

Enables static file serving in the YARP resource.

## Definition

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

## Signature

```typescript
withStaticFiles(sourcePath?: string): YarpResource
```

## Parameters

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

## Returns

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

## Defined on

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