Optional
abortSignal to shut down the server.
Optional
catchCatches CTRL+C
and shuts down the server gracefully.
Optional
hostnameHostname to bind the server to.
Defaults to not specific binding.
Optional
onCalled once the server started listening.
Optional
portPort to run the server on.
Defaults to random available port.
Optional
shutdownMaximum time (in milliseconds) to wait before returning.
This will unref
the server once the timeout expired and return early. The server will still be open until your
program exits.
Optional
trustWhether to trust proxy headers.
When set to true, forwarded-for-*
headers will be considered.
Optional
unrefStarts the server in unref
ed mode.
This is primarily useful in test environments so that an unclosed server doesn't prevent your tests from existing.
Configuration options for starting a server.