Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maximilianschmitt/mirco
Easy microservices for node.js.
https://github.com/maximilianschmitt/mirco
Last synced: 3 months ago
JSON representation
Easy microservices for node.js.
- Host: GitHub
- URL: https://github.com/maximilianschmitt/mirco
- Owner: maximilianschmitt
- License: mit
- Created: 2015-03-18T23:14:24.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-04-14T17:37:18.000Z (over 9 years ago)
- Last Synced: 2024-10-03T01:38:05.661Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 164 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# mirco
![Travis Build](http://img.shields.io/travis/maximilianschmitt/mirco.svg?style=flat)
Easy microservices for node.js.
## Installation
```
$ npm install mirco
```## Usage
Check out the tests for more information on what you can do with mirco.
### Server
```js
'use strict';let service = require('mirco');
let server = service({
hello: function(payload) {
return 'Hello, ' + payload.name;
}
}, [{
method: 'hello',
returns: 'greeting'
}]);server.listen(process.env.SERVICE_PORT);
```### Client
```js
'use strict';let axios = require('axios');
axios
.post('http://localhost:' + process.env.SERVICE_PORT + '/hello', {
name: 'Max'
})
.then(res => console.log(res.data)); // { greeting: 'Hello, Max' }
```