new ServiceRunner()
Sandboxed service runner. This runner uses the vm2
package to run end points in a fully isolated context. Endpoints, pre-middleware and post-middleware all run as independant precompiled VMScript
s.
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 |
- Source
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: