Constructor
new Server(params)
Creates a server
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
params |
object |
Properties
|
Methods
delete(url, callback)
Appends a new route using the method DELETE
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Request URL |
callback |
function | Request handler |
get(url, callback)
Appends a new route using the method GET
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Request URL |
callback |
function | Request handler |
patch(url, callback)
Appends a new route using the method PATCH
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Request URL |
callback |
function | Request handler |
post(url, callback)
Appends a new route using the method POST
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Request URL |
callback |
function | Request handler |
put(url, callback)
Appends a new route using the method PUT
Parameters:
| Name | Type | Description |
|---|---|---|
url |
string | Request URL |
callback |
function | Request handler |
start() → {Promise}
Starts the server
Returns:
- Type
- Promise