new ServiceRunnerNode()
Unsafe service runner. This service runner uses eval
to run services, endpoints and tasks. This provides only simple context seperation and does not do effective context isolation. This should only be used where the service is knwon trustworthy. When the useNative
option is set to true the service will run in the same context as this class with no isolation at all.
Parameters:
Name | Type | Description |
---|---|---|
options.service | module:Service. | The service to load endpoints from |
options.party | module:Party. | The party to pass to the endpoints |
options.sendFullErrors | boolean | If true send full stack traces to clients. Defaults to false |
options.prefix | string | A prefix to apply to all endpoint paths |
options.router | Router | Router, defaults to |
options.useNative | boolean |
Methods
(static) onRequest(req, res)
Expressjs style way of calling an endpoint. The req will be passed to the router to select the appropritate endpoint
Parameters:
Name | Type | Description |
---|---|---|
req | Express. | |
res | Express. |
Returns: