Service. IService

new IService(build)

A service with schema, documents, endpoints, middleware and tasks. Provide either paths to source files for compilation or provided a pre-built service to import.

Parameters:
NameTypeDescription
options.name*
options.version*
options.githash*
options.branch*
build*

Methods

(static) addDocument(document_path)

Add a document class implementation to the service

Parameters:
NameTypeDescription
document_pathstring

(static) addEndpoint(endpoint_path)

Add a dataparty endpoint to the service by pather

Parameters:
NameTypeDescription
endpoint_pathstring

(static) addEndpoint(middleware_path)

Add a middleware to this service

Parameters:
NameTypeDescription
middleware_pathstring

(static) addSchema(schema_path)

Add a dataparty schema implementation to the service

Parameters:
NameTypeDescription
schema_pathmodule:Service.IService

(static) addTask(task_path)

Add a tasker task implementation to the service

Parameters:
NameTypeDescription
task_pathstring

(async, static) compile(outputPath, writeFile)

Compile a service. This will build two output files, one for host usage -service.json and another for client usage -schema.json.

Parameters:
NameTypeDescription
outputPathstring

Path where the built service should be written

writeFileboolean

When true, files will be written. Defaults to true

Returns:

(static) importBuild(buildOutput)

Import a pre-build service

Parameters:
NameTypeDescription
buildOutputObject