> 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.

# start

> Start the HTTP or HTTPS service.

Start the HTTP or HTTPS service. The service uses HTTPS when SSL is fully configured, either through the `ssl` constructor option or the `sslCert` and `sslKey` arguments.

> **Note**
>
> When `SWAIG_CLI_MODE=true` is set in the environment, the call is a no-op so you can inspect configuration without binding a port.

## Parameters

**`host`** `string` — default: 0.0.0.0

Bind address.

---

**`port`** `number`

Port override. Defaults to the service's `port`.

---

**`sslCert`** `string`

Path to the SSL certificate file. Overrides the `ssl` constructor option when passed together with `sslKey`.

---

**`sslKey`** `string`

Path to the SSL key file.

---

## Returns

`Promise<void>` -- resolves once the server has begun listening.

Throws an `Error` if no basic-auth credentials are configured: the `basicAuth` option, the config file's `security.auth.basic`, or `SWML_BASIC_AUTH_USER` and `SWML_BASIC_AUTH_PASSWORD`.

## Example

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

const web = new WebService({
  directories: { '/audio': './public/audio' },
  basicAuth: ['audio', process.env['AUDIO_PASSWORD'] ?? ''],
});

await web.start('127.0.0.1', 8080);
```