> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# stop

> Stop the HTTP server started by run() or serve().

[ref-run]: /docs/server-sdks/reference/typescript/agents/swml-service/run

[ref-serve]: /docs/server-sdks/reference/typescript/agents/swml-service/serve

Stop the HTTP server started by [`run()`][ref-run] or
[`serve()`][ref-serve]. Closes the underlying `@hono/node-server`
instance and releases the port.

<Note>
  Unlike the Python counterpart (which only flips an internal flag), the TypeScript
  `stop()` actually closes the listener. It is safe to call when no server is
  running -- it no-ops if the service hasn't been started.
</Note>

## **Returns**

`void`

## **Example**

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

const service = new SWMLService({ name: 'my-service' });
await service.run({ host: '0.0.0.0', port: 3000 });

// In a signal handler or shutdown hook:
process.on('SIGINT', () => {
  service.stop();
  process.exit(0);
});
```