method HTTPServer.prototype.close
HTTPServer.prototype.close(): Promise<void>

Closes the underlying HTTP server and all active connections, returning a Promise that resolves once the server is fully closed.

const server = new HTTPServer();
await server.close(); // resolves even if listen() never happened

Return Type

Promise<void>

Usage

import { HTTPServer } from "lib/web/index.ts";