@mesg/api
Website - Docs - Forum - Chat - Blog
This library responsible for the communication with the MESG Engine API. It handles the conversion of the data to protobuf messages sent to the GRPC server providing functions with promises for unary calls and event emitters for the different streams that are available in the API.
Contents
Installation
npm install @mesg/api
API
const API = require('@mesg/api')
const api = new API('localhost:50052')
You can now access all the different resources of the MESG engine with the following pattern:
api.resource.action(parameters)
Here are few examples:
- list all the services:
api.service.list({})
- create a service:
api.service.create({ tasks: ... })
- get a stream of executions:
api.execution.stream({})
More details about the different API available here