https://github.com/dot-microservices/dot-rest
a minimalist toolkit for building scalable, fault tolerant and eventually-consistent microservices
https://github.com/dot-microservices/dot-rest
clerq fault-tolerance microservice-framework microservice-toolkit microservices rest rpc soa
Last synced: 7 months ago
JSON representation
a minimalist toolkit for building scalable, fault tolerant and eventually-consistent microservices
- Host: GitHub
- URL: https://github.com/dot-microservices/dot-rest
- Owner: dot-microservices
- License: mit
- Created: 2019-05-12T12:53:59.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-10T16:01:39.000Z (over 2 years ago)
- Last Synced: 2025-08-09T04:51:36.475Z (8 months ago)
- Topics: clerq, fault-tolerance, microservice-framework, microservice-toolkit, microservices, rest, rpc, soa
- Language: JavaScript
- Size: 1000 KB
- Stars: 45
- Watchers: 4
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dot-rest
a minimalist toolkit for building fast, scalable and fault tolerant microservices
## Configuration
- **host :** binds server instance to this value. it's 0.0.0.0 by default.
- **pino :** options for pino logger. it's { "level": "error" } by default.
- **port :** start point for port assignment. it's 8000 by default.
## Examples
```js
const Clerq = require('clerq');
const { Client, Server } = require('dot-rest');
const IORedis = require('ioredis');
class Service {
static _configure() {
return {
echo: [ '*', '/:path' ]
};
}
static _name() {
return 'myService';
}
static async echo(req) { // ? , res
return req.params;
}
}
const registry = new Clerq(new IORedis(), { expire: 5, pino: { level: 'error' } });
const client = new Client(registry, { expire: 5, pino: { level: 'error' } });
const server = new Server(registry, { expire: 5, pino: { level: 'error' } });
server.start()
.then(() => server.addService(Service))
.catch(console.log);
setTimeout(async() => {
const r = await client.get(Server._unCamelCase(Service._name()), 'test');
console.log(r.data);
server.stop();
client.close();
}, 500);
```