Constructor
new Server(router)
Create a Server instance.
Parameters:
Name | Type | Description |
---|---|---|
router |
Router | The Router to be used for this Server |
Methods
start(host, port) → {Promise}
Start this Server for a host on a port.
Parameters:
Name | Type | Default | Description |
---|---|---|---|
host |
string | localhost | The host |
port |
number | 1337 | The port |
Returns:
A promise that resolves when the server has started
- Type
- Promise
stop() → {Promise}
Stops the server.
Returns:
A promise that resolves when the server has stopped
- Type
- Promise