This package has been deprecated
Author message:
this package was renamed to mirco
express-micro-service
0.1.1 • Public • Published express-micro-service
Easy microservices powered by Express.
Installation
$ npm install express-micro-service
Usage
Check out the tests for more information on what you can do with express-micro-service.
Server
'use strict';
let service = require('express-micro-service');
let server = service({
hello: function(payload) {
return 'Hello, ' + payload.name;
}
}, [
{
method: 'hello',
returns: 'greeting'
}
]);
server.listen(process.env.SERVICE_PORT);
Client
'use strict';
let axios = require('axios');
axios
.post('http://localhost:' + process.env.SERVICE_PORT + '/hello', {
name: 'Max'
})
.then(res => {
console.log(res.data);
});
Readme
Keywords
nonePackage Sidebar
Install
npm i express-micro-service
Weekly Downloads