Node.js client for matter in motion framework
npm i mm-client-nodejs
const client = require('mm-client');
const mm = client({
host: 'localhost:3000'
});
mm('?').then(res => console.log(res));
Creates a client function. Options:
- host β string, API host. IP or domain.
- tls β boolean, default
false
. Use TLS (https) connection or not. - api β string, default
/api
. API path - serializer β serializer to use. By default client uses JSON serializer except for sending files it uses FormData.
- meta β request metadata, will be used in every request with empty meta
Makes a call. Returns a Promise.
- call β string, resource call
- data β object, data to send
- opts
- header β object, headers to add to the request
- meta β metadata to send with the request
- files β the array of paths or streams to send
- agent β as in https://github.com/sindresorhus/got#proxies
License: MIT