Create a new RestServer for the passed protocol. The server will initially be stopped!
Protocol implementation to handle all requests
returns true if the server is active and accepting connections.
Close the server and stop accepting connections. Call listen() to start the server again.
Start listening for incoming requests. If the port is unavailable, the listen call will be retried every second until the socket is opened successfully or close() is called.
TCP port to listen on; omit to use the protocol's default port
hostname/IP to bind to; omit for localhost
a promise that resolves once the server is up and running
Exposes a Protocol on a TCP port