import { Server } from "https://deno.land/x/ayonli_jsext@v0.9.72/http/server.ts";
A unified HTTP server interface.
Constructors
Properties
A request handler for using the server instance as an ES module worker,
only available when the server type is module
.
The hostname of which the server is listening on, only available after
the server is ready and the server type is classic
.
The port of which the server is listening on, only available after the
server is ready and the server type is classic
.
Methods
Closes the server and stops it from accepting new connections. By default,
this function will wait until all active connections to close before
shutting down the server. However, we can force the server to close all
active connections and shutdown immediately by setting the force
parameter to true
.
NOTE: In Node.js, the force
parameter is only available for HTTP
servers, it has no effect on HTTP2 servers.
Opposite of unref()
, calling ref()
on a previously unref
ed server
will not let the program exit if it's the only server left (the default
behavior). If the server is ref
ed calling ref()
again will have no
effect.
Calling unref()
on a server will allow the program to exit if this is
the only active server in the event system. If the server is already
unref
ed callingunref()
again will have no effect.