Class: Procedure

Procedure

new Procedure(name, method)

This class handles remote procedure call generation. It is an extension of the NodeApiServer class and is primarily used there. It allows procedures to be created that are exposed to remote clients via the REST interface. Procedures handle their own server code including responding to clients directly.
Parameters:
Name Type Description
name String The name of the procedure.
method function The handler method.
Source:

Methods

(static) name(nameopt)

Get / set the procedure name.
Parameters:
Name Type Attributes Description
name String <optional>
The name to set.
Source:

exec(req, res) → {*}

Execute the procedure, passing in the request and response (req and res) arguments from the server. Procedure methods are responsible for correctly communicating with the client and handling response properly.
Parameters:
Name Type Description
req
res
Source:
Returns:
Type
*

init(name, method)

Create a remote procedure call.
Parameters:
Name Type Description
name String The name of the procedure.
method function The procedure handler.
Source: