Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/roqueando/nous
Un orchestre parmi nous
https://github.com/roqueando/nous
Last synced: 3 months ago
JSON representation
Un orchestre parmi nous
- Host: GitHub
- URL: https://github.com/roqueando/nous
- Owner: roqueando
- Created: 2020-03-16T19:54:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T02:43:04.000Z (almost 2 years ago)
- Last Synced: 2024-06-30T16:52:09.743Z (5 months ago)
- Language: TypeScript
- Homepage:
- Size: 668 KB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
bienvenue 👋
> Un orchestre parmi nous. beta.
## Install
```sh
yarn install
npm install
```## Usage
```javascript
const {Manager} = require('@roqueando/nous');
const fs = require('fs');const manager = new Manager(8080);
manager.run(); // a new server is running in port 8080 waiting for services and messages
console.log('Manager running on 8080');// for multiple services
const files = fs.readdirSync('./services'); // assuming if services folder is in root path
files.forEach((file) => {
const service = require(`./services/${file}`);
const newService = new service();
newService.setName('nameForService');
newService.run(); // this will register on Manager and be ready for receive messages.
console.log(`Running ${newService.name} at ${newService.port}`);
});// for one service
const service = require('./services/service.js');
const newService = new service();
service.setName('aServiceName');
service.run();
```## Run tests
```sh
yarn test
```## API
### Manager
`new Manager` a new instance to manager server, which one can receive messages, actions and distribute to all other services
### Service
`new Service` anything that is extended as Service, will be a server with your business logic in TCP or HTTP connection.
Services can communicate with Manager and other services via TCP, and can be HTTP or TCP node.
### Router
`new Router` a router its only for HTTP services, that can up routes and handlers for service like a "express" app.
### Client
`new Client` a client to connect to manager and send actions and receive data. Can be used in front too.
### Token
`new Token` a JWT Token generator.
## Authors
👤 **roqueando**
* Twitter: [@rockroqueando](https://twitter.com/rockroqueando)
* Github: [@roqueando](https://github.com/roqueando)👤 **christopy**
* Github: [@christopy](https://github.com/christopy)
##
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/roqueando/nous/issues).## Show your support
Give a ⭐️ if this project helped you!
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_