new ServerAPI(setup)
Creates an instance of ServerAPI.
Parameters:
| Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
setup |
Object | Configuration options for the server. Properties
|
- Source:
Methods
createEndpoint(endpoint)
Creates an endpoint for the server.
Parameters:
| Name | Type | Description |
|---|---|---|
endpoint |
Endpoint | The endpoint to be created. |
- Source:
Throws:
-
If the endpoint parameter is not an instance of the Endpoint class.
- Type
- Error.Log
(async) init()
Initializes the server, setting up routes, middleware, and listeners.
- Source:
listen(PORT, callback)
Starts the server to listen on the specified port.
Parameters:
| Name | Type | Description |
|---|---|---|
PORT |
number | The port number on which the server will listen. |
callback |
function | Callback function to be executed when the server starts listening. |
- Source:
listenSSL(PORT, keySSLPath, certSSLPath, callback)
Starts the server with SSL encryption to listen on the specified port.
Parameters:
| Name | Type | Description |
|---|---|---|
PORT |
number | The port number on which the server will listen. |
keySSLPath |
string | The path to the SSL key file. |
certSSLPath |
string | The path to the SSL certificate file. |
callback |
function | Callback function to be executed when the server starts listening. |
- Source:
runAppQueue()
Runs the queued application functions.
- Source: