1.0.7-beta.1 • Published 4 years ago
servious v1.0.7-beta.1
Servious - Node.js zero-configuration microservices made easy
Servious is a modern zero configuration microservice library. Absolutely no third party libraries required.
Servious is still in early beta. Help us out by reporting any bugs.
Your first microservice in 30 seconds.
Installation
npm install servious --save
Example requester.js
import servious from 'servious'
servious.configure(); // Any global config here
// Link this instance with any other services to whom requests will be made
servious.addLink({
name: 'my-service',
service: 'my-service', // The service you wish to target with this link
options: {
namespace: 'custom-namespace', // Optional namespace
}
});
// Send a test request to my-service
const req = await servious.send('my-service', 'generate-number', { payload: { 1: Math.round(Math.random(), 2) } });
console.log(req)
Example responder.js
import servious from 'servious'
servious.configure(); // Any global config here
// Register this service as a responder
servious.registerResponder({
name: 'my-service', // The name of your service
namespace: 'custom-namespace' // Optional namespace
});
// Add a handler for function "generate-number"
servious.on('generate-number', async (req) => {
console.log(`Received request ${JSON.stringify(req)}`);
return Math.random();
});
Further documentation pending
1.0.7-beta.1
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.3-beta.4
4 years ago
1.0.3-beta.3
4 years ago
1.0.3-beta.2
4 years ago
1.0.3-beta.1
4 years ago
1.0.3-beta.0
4 years ago
1.0.2
4 years ago
1.0.1-r.1
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago