> This page is for Server SDKs.

> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# addDirectory

> Add a directory to serve at a URL route prefix.

Add a directory to serve at a URL route prefix. You can call it before or after the service starts; the route serves from the next request.

## Parameters

**`route`** `string` — required

URL prefix, for example `'/docs'`. A leading `/` is added if missing.

---

**`directory`** `string` — required

Local directory path to serve.

---

## Returns

`void`

Throws an `Error` if the directory does not exist or the path is not a directory.

## Example

```typescript
import { WebService } from '@signalwire/sdk';

const web = new WebService({
  basicAuth: ['assets', process.env['ASSETS_PASSWORD'] ?? ''],
});

web.addDirectory('/images', './public/images');

await web.start();
```