Service. ServiceRunnerNode

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:
NameTypeDescription
options.servicemodule:Service.IService

The service to load endpoints from

options.partymodule:Party.IParty

The party to pass to the endpoints

options.sendFullErrorsboolean

If true send full stack traces to clients. Defaults to false

options.prefixstring

A prefix to apply to all endpoint paths

options.routerRouter

Router, defaults to origin-router

options.useNativeboolean

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:
NameTypeDescription
reqExpress.Request
resExpress.Response
Returns: