ManageALocalServer
Hierarchy
- Ability
- ManageALocalServer
Index
Constructors
Methods
Constructors
constructor
Parameters
protocol: SupportedProtocols
Protocol to be used when communicating with the running server;
http
orhttps
server: Server
A Node.js server requestListener, with support for server shutdown.
Returns ManageALocalServer
Methods
staticrunningAHttpListener
An Ability to manage a Node.js HTTP server using the provided
requestListener
.Parameters
listener: RequestListener | Server
Returns ManageALocalServer
staticrunningAHttpsListener
An Ability to manage a Node.js HTTPS server using the provided server
requestListener
.Parameters
listener: RequestListener | Server<typeof IncomingMessage, typeof ServerResponse>
options: ServerOptions<typeof IncomingMessage, typeof ServerResponse> = {}
Accepts an options object from
tls.createServer()
,tls.createSecureContext()
andhttp.createServer()
.
Returns ManageALocalServer
listen
Starts the server on the first free port between
preferredPort
andhighestPort
, inclusive.Parameters
optionalpreferredPort: number = 8000
Lower bound of the preferred port range
optionalhighestPort: number = 65535
highestPort Upper bound of the preferred port range
Returns Promise<void>
mapInstance
Provides access to the server
requestListener
Type parameters
- T
Parameters
fn: (server: ServerWithShutdown, protocol?: SupportedProtocols) => T
Returns T
An Ability that enables an Actor to manage a local Node.js server.
Managing a raw Node.js server
Learn more