> 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. # serve > Start the HTTP server (Python-compat alias for run). [ref-run]: /docs/server-sdks/reference/typescript/agents/swml-service/run [ref-asrouter]: /docs/server-sdks/reference/typescript/agents/swml-service/as-router Start the HTTP server that serves the SWML document. This is a Python-compat alias for [`run()`][ref-run] and forwards all arguments unchanged. Use either name interchangeably -- pick `serve()` when porting code from the Python SDK. > **Note** > > Returns immediately when `SWAIG_CLI_MODE=true` is set, so the CLI testing > tool can load the service without opening a port. > **Warning** > > `serve()` (and `run()`) start a `@hono/node-server` instance that runs until > explicitly stopped. For embedding into an existing application, use > [`asRouter()`][ref-asrouter] to get a mountable Hono sub-app instead. ## **Parameters** **`host`** `string` Hostname to bind to. Defaults to the `host` passed to the constructor, or `"0.0.0.0"`. --- **`port`** `number` Port number to listen on. Defaults to the `port` passed to the constructor, which itself falls back to the `PORT` environment variable or `3000`. --- **`opts`** `object` Optional SSL/TLS overrides. Each field falls back to the matching value on the service instance. --- **`opts.sslCert`** `string` Path to the SSL certificate file. --- **`opts.sslKey`** `string` Path to the SSL private key file. --- **`opts.sslEnabled`** `boolean` Override whether SSL/HTTPS is enabled for this run. --- **`opts.domain`** `string` Domain name associated with the SSL certificate. --- ## **Returns** `Promise` -- resolves once the listener is bound. ## **Example** ```typescript {8} import { SWMLService } from '@signalwire/sdk'; const service = new SWMLService({ name: 'my-service', route: '/swml' }); service.addVerb('answer', {}); service.addVerb('play', { url: 'https://example.com/welcome.mp3' }); // Start on default host/port (0.0.0.0:3000) await service.serve(); // Or override host and port // await service.serve('127.0.0.1', 8080); ``` > Start the HTTP server (Python-compat alias for run).