attributes of the server
Can connections of this server use the chat system?
Shorthand for api.config.servers[this.type]
Methods described by the server to apply to each connection (like connection.setHeader for web connections)
Should we log every new connection?
Should we log when a connection disconnects/exits?
Should every new connection of this server type receive the welcome message (defined in locales, actionhero.welcomeMessage
)
A place to store the actually server object you create
The name & type of the server.
What connection verbs can connections of this type use?
Sets or gets the default captureRejection value for all emitters.
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
this.buildConnection({
rawConnection: {
req: req,
res: res,
params: {},
method: method,
cookies: cookies,
responseHeaders: responseHeaders,
responseHttpCode: responseHttpCode,
parsedURL: parsedURL
},
id: fingerprint + '-' + uuid.v4(),
fingerprint: fingerprint,
remoteAddress: remoteIP,
remotePort: remotePort
})
Enumerate the connections for this server type on this server.
An optional message to send to clients when they disconnect
Method run as part of the initialize
lifecycle of your server. Usually configures the server.
Log a message from this server type. A wrapper around log() with a server prefix.
When a connection has called an Action command, and all properties are set. Connection should have params.action
set at least.
on(event: 'actionComplete', cb: (data: object) => void): this;
When a connection has called an File command, and all properties are set. Connection should have params.file
set at least. Will eventually call Actionhero.Server#sendFile.
Must be defined explaining how to send a file to an individual connection. Might be a noop for some connection types.
Must be defined explaining how to send a message to an individual connection.
Method run as part of the start
lifecycle of your server. Usually boots the server (listens on port, etc).
Method run as part of the stop
lifecycle of your server. Usually configures the server (disconnects from port, etc).
Generated using TypeDoc
Create a new Actionhero Server. The required properties of an server. These can be defined statically (this.name) or as methods which return a value.