Constructor
new Server(botsopt, optionsopt)
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
bots |
Array.<function()> |
<optional> |
Bots whose handle method will be called on incoming requests |
||||||||
options |
object |
<optional> |
Properties
|
Methods
addBot(bot)
Adds bots whose handle functions are called on HTTP requests
Parameters:
Name | Type | Description |
---|---|---|
bot |
Bot |
listen(port, host)
Executes the HTTP Server's listen method
Parameters:
Name | Type | Description |
---|---|---|
port |
number | Port to listen on |
host |
string | Hostname for the server |
- Source:
- See:
request(req, res)
Receives HTTP requests from the API
Parameters:
Name | Type | Description |
---|---|---|
req |
IncomingMessage | Request |
res |
ServerResponse | Response |